/* ===================================================================
   DUAL THEME SYSTEM - Light/Dark Mode Support
   =================================================================== */

/* Default Dark Theme Variables - Elegant Minimalist */
:root[data-theme="dark"], :root {
    /* Brand Colors - Elegant Gold & Gray Palette */
    --color-primary: #c9a961;        /* Muted gold */
    --color-primary-hover: #d4b574;  /* Lighter gold */
    --color-secondary: #8892a6;      /* Soft blue-gray */
    --color-secondary-hover: #9aa4b8; /* Lighter blue-gray */
    --color-accent: #b89968;         /* Warm gold accent */
    --color-accent-hover: #c5a876;   /* Lighter warm gold */

    /* Background Colors - Deep & Sophisticated */
    --bg-primary: #0d1117;           /* Very dark blue-black */
    --bg-secondary: #161b22;         /* Dark gray-blue */
    --bg-tertiary: #21262d;          /* Medium dark gray */
    --bg-card: rgba(33, 38, 45, 0.95); /* Card with opacity */
    --bg-glass: rgba(33, 38, 45, 0.85); /* Glass effect - increased opacity for better visibility */
    --bg-hover: rgba(201, 169, 97, 0.15); /* Gold hover - increased for better feedback */

    /* Text Colors - Soft & Readable */
    --text-primary: #e6edf3;         /* Soft white */
    --text-secondary: #8b949e;       /* Medium gray */
    --text-tertiary: #7d8590;        /* Lighter gray - improved contrast */
    --text-muted: #484f58;           /* Muted gray */

    /* Border & Shadow - Subtle & Elegant */
    --border-color: rgba(201, 169, 97, 0.2); /* Gold-tinted border - more visible */
    --border-hover: rgba(201, 169, 97, 0.35); /* Stronger gold border */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.8);

    /* Glow effects for accent elements */
    --glow-primary: 0 0 20px rgba(201, 169, 97, 0.3);
    --glow-accent: 0 0 15px rgba(184, 153, 104, 0.4);

    /* Gradients - Elegant & Subtle */
    --gradient-primary: linear-gradient(135deg, #c9a961 0%, #8892a6 100%);
    --gradient-secondary: linear-gradient(135deg, #8892a6 0%, #6e7681 100%);
    --gradient-hero: linear-gradient(135deg, #c9a961 0%, #8892a6 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(13, 17, 23, 0) 0%, rgba(13, 17, 23, 0.85) 100%);

    /* Status Colors - Muted & Professional */
    --color-success: #7fba7a;        /* Muted green */
    --color-warning: #d4a574;        /* Muted orange */
    --color-error: #d97777;          /* Muted red */
    --color-info: #8892a6;           /* Soft blue-gray */

    /* Background for status */
    --bg-success: rgba(127, 186, 122, 0.1);
    --bg-warning: rgba(212, 165, 116, 0.1);
    --bg-error: rgba(217, 119, 119, 0.1);
    --bg-info: rgba(136, 146, 166, 0.1);
}

/* Light Theme Variables - Elegant Minimalist */
:root[data-theme="light"] {
    /* Brand Colors - Refined Gold & Gray */
    --color-primary: #b8935c;        /* Darker gold for light mode */
    --color-primary-hover: #a17d47;  /* Even darker on hover */
    --color-secondary: #6b7689;      /* Darker blue-gray */
    --color-secondary-hover: #5a6478; /* Darker on hover */
    --color-accent: #a88556;         /* Warm gold */
    --color-accent-hover: #946f42;   /* Darker warm gold */

    /* Background Colors - Clean & Bright */
    --bg-primary: #fafbfc;           /* Soft white */
    --bg-secondary: #f6f8fa;         /* Light gray */
    --bg-tertiary: #eef1f4;          /* Medium light gray */
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-hover: rgba(184, 147, 92, 0.06);

    /* Text Colors - Clear & Readable */
    --text-primary: #24292f;         /* Dark gray */
    --text-secondary: #57606a;       /* Medium gray */
    --text-tertiary: #6e7781;        /* Light gray */
    --text-muted: #8c959f;           /* Very light gray */

    /* Border & Shadow - Subtle */
    --border-color: rgba(184, 147, 92, 0.15);
    --border-hover: rgba(184, 147, 92, 0.3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 24px rgba(0, 0, 0, 0.12);

    /* Gradients - Refined */
    --gradient-primary: linear-gradient(135deg, #b8935c 0%, #6b7689 100%);
    --gradient-secondary: linear-gradient(135deg, #6b7689 0%, #57606a 100%);
    --gradient-hero: linear-gradient(135deg, #b8935c 0%, #6b7689 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(250, 251, 252, 0) 0%, rgba(250, 251, 252, 0.9) 100%);

    /* Status Colors - Professional */
    --color-success: #5fa55a;
    --color-warning: #c2935d;
    --color-error: #c76161;
    --color-info: #6b7689;

    /* Background for status */
    --bg-success: rgba(95, 165, 90, 0.1);
    --bg-warning: rgba(194, 147, 93, 0.1);
    --bg-error: rgba(199, 97, 97, 0.1);
    --bg-info: rgba(107, 118, 137, 0.1);
}

/* ===================================================================
   COMMON THEME VARIABLES (Same for both themes)
   =================================================================== */
:root {
    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2;

    /* Spacing */
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    --space-24: 6rem;        /* 96px */

    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index */
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-modal: 1200;
    --z-tooltip: 1300;
    --z-notification: 1400;
}

/* ===================================================================
   THEME APPLICATION
   =================================================================== */

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family-base);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* Cards - Enhanced with better borders and shadows */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Glass Morphism - Enhanced visibility */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Buttons */
.btn {
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.fade-in-up {
    animation: fadeInUp var(--transition-base) ease-out;
}

.slide-in {
    animation: slideIn var(--transition-base) ease-out;
}

.scale-in {
    animation: scaleIn var(--transition-base) ease-out;
}

/* Utility Classes */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--bg-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-card { background-color: var(--bg-card) !important; }

/* Theme Toggle Transition */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: var(--transition-base);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable transitions during page load */
.preload * {
    transition: none !important;
}
