/* ==========================================================================
   Theme Styles - Dark Mode & Customization
   ========================================================================== */

/* Dark Mode */
[data-theme="dark"] {
    /* Colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #94a3b8;
    --success-color: #22c55e;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --info-color: #38bdf8;

    /* Backgrounds */
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --bg-hover: #475569;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Borders */
    --border-color: #334155;
    --border-dark: #475569;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Alternative Color Schemes */

/* Blue Theme */
[data-theme="blue"] {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
}

/* Green Theme */
[data-theme="green"] {
    --primary-color: #10b981;
    --primary-hover: #059669;
}

/* Purple Theme */
[data-theme="purple"] {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
}

/* Orange Theme */
[data-theme="orange"] {
    --primary-color: #f59e0b;
    --primary-hover: #d97706;
}

/* Red Theme */
[data-theme="red"] {
    --primary-color: #ef4444;
    --primary-hover: #dc2626;
}

/* ==========================================================================
   Custom Task Colors
   ========================================================================== */

.task-color-red {
    border-left: 4px solid #ef4444;
}

.task-color-orange {
    border-left: 4px solid #f59e0b;
}

.task-color-yellow {
    border-left: 4px solid #eab308;
}

.task-color-green {
    border-left: 4px solid #10b981;
}

.task-color-blue {
    border-left: 4px solid #3b82f6;
}

.task-color-purple {
    border-left: 4px solid #8b5cf6;
}

.task-color-pink {
    border-left: 4px solid #ec4899;
}

.task-color-gray {
    border-left: 4px solid #64748b;
}

/* Gantt Task Bar Colors */
.gantt-task-bar.color-red {
    background-color: #ef4444;
}

.gantt-task-bar.color-orange {
    background-color: #f59e0b;
}

.gantt-task-bar.color-yellow {
    background-color: #eab308;
}

.gantt-task-bar.color-green {
    background-color: #10b981;
}

.gantt-task-bar.color-blue {
    background-color: #3b82f6;
}

.gantt-task-bar.color-purple {
    background-color: #8b5cf6;
}

.gantt-task-bar.color-pink {
    background-color: #ec4899;
}

.gantt-task-bar.color-gray {
    background-color: #64748b;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }

    [data-theme="dark"] {
        --border-color: #ffffff;
        --text-secondary: #ffffff;
    }

    .btn {
        border-width: 2px;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body {
        background-color: white;
        color: black;
    }

    .app-header,
    .view-tabs,
    .toolbar,
    .status-bar,
    .modal {
        display: none;
    }

    .main-content {
        height: auto;
        overflow: visible;
    }

    .view-container {
        display: block;
        page-break-after: always;
    }

    .gantt-chart-panel,
    .wbs-list-panel {
        overflow: visible;
    }

    .dashboard-card {
        break-inside: avoid;
    }

    /* Ensure charts are visible */
    canvas {
        max-width: 100%;
        height: auto;
    }
}

/* ==========================================================================
   Theme Toggle Button (for settings panel)
   ========================================================================== */

.theme-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-option {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    border-color: var(--border-dark);
    transform: scale(1.05);
}

.theme-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.theme-option::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 2px;
    color: white;
    background-color: var(--primary-color);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.theme-option.active::after {
    opacity: 1;
}

/* Theme preview colors */
.theme-option[data-theme="light"] {
    background: linear-gradient(to bottom, #f8fafc 50%, #ffffff 50%);
}

.theme-option[data-theme="dark"] {
    background: linear-gradient(to bottom, #0f172a 50%, #1e293b 50%);
}

.theme-option[data-theme="blue"] {
    background: linear-gradient(to bottom, #dbeafe 50%, #2563eb 50%);
}

.theme-option[data-theme="green"] {
    background: linear-gradient(to bottom, #dcfce7 50%, #10b981 50%);
}

.theme-option[data-theme="purple"] {
    background: linear-gradient(to bottom, #f3e8ff 50%, #8b5cf6 50%);
}

.theme-option[data-theme="orange"] {
    background: linear-gradient(to bottom, #fed7aa 50%, #f59e0b 50%);
}

.theme-option[data-theme="red"] {
    background: linear-gradient(to bottom, #fee2e2 50%, #ef4444 50%);
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) var(--bg-secondary);
}
