/* ===== Design Tokens ===== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-accent: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --primary-gradient-h: linear-gradient(to right, #667eea, #764ba2);

    --secondary: #2d3748;
    --secondary-dark: #1a202c;

    --text: #333;
    --text-light: #666;
    --text-muted: #718096;
    --text-secondary: #4a5568;

    --bg: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    --surface: #fff;
    --surface-alt: #fafbff;
    --surface-hover: #f0f0ff;

    --border: #e2e8f0;
    --border-light: #eee;
    --border-input: #ddd;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);

    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-pill: 50px;

    --font: 'Helvetica Neue', Arial, sans-serif;
    --container-max: 1200px;
    --content-max: 800px;
    --nav-height: 60px;
    --section-py: 80px;
    --gap: 20px;

    --color-success: #27ae60;
    --color-error: #e74c3c;
    --color-warning: #f39c12;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
    --text: #e2e8f0;
    --text-light: #a0aec0;
    --text-muted: #718096;
    --text-secondary: #cbd5e0;

    --bg: #1a202c;
    --bg-gradient: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --surface: #2d3748;
    --surface-alt: #2d3748;
    --surface-hover: #4a5568;

    --border: #4a5568;
    --border-light: #4a5568;
    --border-input: #4a5568;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.4);

    --secondary: #e2e8f0;
    --secondary-dark: #cbd5e0;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Base ===== */
body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxjaXJjbGUgY3g9IjIwIiBjeT0iMjAiIHI9IjAuNSIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNwYXR0ZXJuKSIvPjwvc3ZnPg==');
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.2s;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
}

/* ===== Navigation ===== */
nav:not(.breadcrumb) {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    transition: box-shadow 0.3s ease;
}

[data-theme="dark"] nav:not(.breadcrumb) {
    background-color: rgba(45, 55, 72, 0.95);
}

nav:not(.breadcrumb):hover {
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gap);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-list {
    display: flex;
    list-style: none;
    height: 100%;
    gap: 4px;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    height: 100%;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--surface-hover);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-gradient-h);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
}

/* ===== Language Switcher ===== */
.language-switcher {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

.language-link {
    padding: 5px 12px;
    border-radius: 20px;
    border: 2px solid var(--primary);
    background-color: var(--surface);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

.language-link:hover {
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.language-link.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Container ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* ===== Section ===== */
section {
    padding: var(--section-py) 0;
}

section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: var(--text);
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-gradient-h);
    border-radius: 2px;
}

/* ===== Footer ===== */
footer {
    margin-top: 40px;
    padding: 30px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f39c12);
}

footer p {
    margin: 10px 0;
    line-height: 1.6;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

footer a:hover {
    color: var(--primary-accent);
    text-decoration: underline;
}

/* ===== Buttons ===== */
.btn,
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(102, 126, 234, 0.4);
    opacity: 0.95;
}

.btn:active,
.btn-primary:active {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

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

/* ===== Messages ===== */
.message-success {
    color: var(--color-success);
    padding: 15px;
    border-radius: var(--radius);
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.message-error {
    color: var(--color-error);
    padding: 15px;
    border-radius: var(--radius);
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

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

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

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
    font-size: 1.2rem;
    margin-left: 8px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--surface-hover);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px;
        scrollbar-width: thin;
        scrollbar-color: var(--primary) var(--border);
    }

    .nav-container::-webkit-scrollbar {
        height: 3px;
    }

    .nav-container::-webkit-scrollbar-track {
        background: var(--border);
    }

    .nav-container::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 2px;
    }

    .nav-list {
        flex-wrap: nowrap;
    }

    .nav-item {
        flex-shrink: 0;
    }

    .nav-link {
        padding: 0 10px;
        font-size: 0.85rem;
    }

    .language-switcher {
        gap: 6px;
        margin-left: 12px;
    }

    .language-link {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    section {
        padding: 50px 0;
    }

    section h2 {
        font-size: 1.8rem;
    }

    footer {
        padding: 20px;
        margin-top: 30px;
    }

    footer p {
        font-size: 0.85rem;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
