/* CSS Custom Properties - Design System */
:root {
    /* Primary Colors */
    --color-primary: #2b5b5b;
    --color-primary-dark: #1e4444;
    --color-primary-light: #3d7a7a;

    /* Secondary Colors */
    --color-secondary: #c9364a;
    --color-secondary-dark: #a62d3e;
    --color-secondary-light: #e04d60;

    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #f1f3f5;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #868e96;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;
    --color-black: #000000;

    /* Semantic Colors */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;

    /* Background Colors */
    --bg-body: #f5f7fa;
    --bg-card: var(--color-white);
    --bg-header: var(--color-primary);

    /* Typography */
    --font-family-primary: 'Montserrat', 'Segoe UI', sans-serif;
    --font-family-secondary: 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-family-display: 'Montserrat', sans-serif;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-tooltip: 400;

    /* Container */
    --container-max: 1200px;
    --container-padding: var(--space-4);
}

/* Dark Theme (Antigravity Style) */
.dark-theme {
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --color-white: #21262d;
    --color-gray-50: #1a1f26;
    --color-gray-100: #21262d;
    --color-gray-200: #30363d;
    --color-gray-300: #484f58;
    --color-gray-400: #6e7681;
    --color-gray-500: #8b949e;
    --color-gray-600: #c9d1d9;
    --color-gray-700: #e6edf3;
    --color-gray-800: #f0f6fc;
    --color-gray-900: #ffffff;

    /* Bright cyan for high contrast */
    --color-primary: #00d4ff;
    --color-primary-dark: #00b4d8;
    --color-primary-light: #48cae4;

    /* Keep secondary accent */
    --color-secondary: #ff6b9d;
    --color-secondary-dark: #e05586;
    --color-secondary-light: #ff8bb4;
}

/* Theme toggle button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: var(--space-4);
}

.theme-toggle:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Icon visibility states */
.theme-icon-dark {
    display: none;
}

.dark-theme .theme-icon-light {
    display: none;
}

.dark-theme .theme-icon-dark {
    display: block;
}

/* Dark theme adjustments for header */
.dark-theme .header {
    background: #161b22;
    box-shadow: 0 1px 0 rgba(0, 212, 255, 0.1);
}

.dark-theme .logo {
    color: #00d4ff;
}

.dark-theme .nav-link {
    color: #c9d1d9;
}

.dark-theme .nav-link:hover {
    color: #00d4ff;
}

/* Dark theme for editor toolbar */
.dark-theme .editor-toolbar {
    background: #161b22;
    border-color: #30363d;
}

.dark-theme .toolbar-title {
    color: #e6edf3;
}

/* Dark theme for form panels */
.dark-theme .editor-form-panel {
    background: #0d1117;
}

.dark-theme .form-section {
    background: #161b22;
    border-color: #30363d;
}

.dark-theme .form-section-header {
    background: linear-gradient(135deg, #00b4d8 0%, #00d4ff 100%);
}

.dark-theme .form-section-content {
    background: #161b22;
}

.dark-theme .form-input,
.dark-theme .form-textarea,
.dark-theme .form-select {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

.dark-theme .form-input::placeholder,
.dark-theme .form-textarea::placeholder {
    color: #6e7681;
}

.dark-theme .form-label {
    color: #c9d1d9;
}

/* Dark theme for preview panel (container stays dark, but CV sheet stays white) */
.dark-theme .editor-preview-panel {
    background: #161b22;
}

/* IMPORTANT: CV preview sheet must always be white (like printed paper) */
.dark-theme .preview-container,
.dark-theme .cv-preview,
.dark-theme #cvPreview {
    background: #ffffff !important;
    color: #333333 !important;
}

/* Keep CV content with original light theme colors */
.dark-theme .cv-body {
    background: #ffffff;
    color: #333333;
}

.dark-theme .cv-section-content {
    color: #333333;
}

.dark-theme .cv-section-header {
    /* Keep original header colors defined by template */
}

/* Dark theme for entry items */
.dark-theme .entry-item {
    background: #21262d;
    border-color: #30363d;
}

.dark-theme .entry-header {
    border-color: #30363d;
}

/* Dark theme for customization panel */
.dark-theme .customization-panel {
    background: #161b22;
    border-color: #30363d;
}

.dark-theme .customization-panel h3,
.dark-theme .customization-section-title {
    color: #e6edf3;
}

/* Dark theme for buttons */
.dark-theme .btn-primary {
    background: linear-gradient(135deg, #00d4ff, #00b4d8);
}

.dark-theme .btn-secondary {
    background: transparent;
    border-color: #00d4ff;
    color: #00d4ff;
}

.dark-theme .btn-secondary:hover {
    background: #00d4ff;
    color: #0d1117;
}