/* ==========================================
   DARK MODE - Override de variables
   No modifica archivos existentes
   ========================================== */

/* ---- Variables oscuras ---- */
[data-theme="dark"] {
    --color-white: #1A1F2E;
    --color-off-white: #151925;
    --color-light-gray: #2A3040;
    --color-gray: #4A5568;
    --color-dark-gray: #A0AEC0;
    --color-charcoal: #CBD5E0;
    --color-navy: #E2E8F0;

    --color-blue-50: rgba(43, 125, 233, 0.1);
    --color-blue-100: rgba(43, 125, 233, 0.15);
    --color-blue-500: #4A9AF5;
    --color-blue-600: #5BA8FF;
    --color-blue-700: #6DB5FF;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ---- Fondos principales que usan colores hardcodeados ---- */
[data-theme="dark"] body {
    background-color: #0F1219;
    color: #CBD5E0;
}

[data-theme="dark"] .navbar {
    background-color: #151925;
    border-bottom-color: #2A3040;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .hero {
    background-color: #0F1219;
}

[data-theme="dark"] .experience {
    background-color: #0F1219;
}

[data-theme="dark"] .projects {
    background-color: #0F1219;
}

[data-theme="dark"] .contact {
    background-color: #0F1219;
}

[data-theme="dark"] .project-hero {
    background-color: #0F1219;
}

[data-theme="dark"] .project-content {
    background-color: #0F1219;
}

[data-theme="dark"] .project-image {
    background-color: #151925;
}

/* Footer */
[data-theme="dark"] .footer {
    background-color: #0A0D14;
}

/* Nav mobile sidebar */
@media (max-width: 768px) {
    [data-theme="dark"] .nav-links {
        background-color: #151925;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    }

    [data-theme="dark"] .nav-links.active::before {
        background-color: rgba(0, 0, 0, 0.6);
    }
}

/* Menu toggle */
[data-theme="dark"] .menu-toggle span {
    background-color: #E2E8F0;
}

/* Form inputs */
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background-color: #1A1F2E;
    border-color: #2A3040;
    color: #CBD5E0;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: #4A9AF5;
    box-shadow: 0 0 0 3px rgba(74, 154, 245, 0.15);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: #4A5568;
}

/* Success message */
[data-theme="dark"] .success-message p {
    color: #A0AEC0;
}

/* Timeline marker border */
[data-theme="dark"] .timeline-marker {
    border-color: #151925;
}

/* Process marker border */
[data-theme="dark"] .process-marker {
    border-color: #0F1219;
    box-shadow: 0 0 0 3px rgba(74, 154, 245, 0.2);
}

/* Notification */
[data-theme="dark"] .project-card {
    background-color: #1A1F2E;
}

/* ---- Botón de tema en navbar ---- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--color-off-white);
    border: 1px solid var(--color-light-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-left: 0.75rem;
    padding: 0;
    color: var(--color-charcoal);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--color-gray);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Transición suave al cambiar tema */
[data-theme-transition] * {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

@media (max-width: 768px) {
    .theme-toggle {
        width: 34px;
        height: 34px;
        margin-left: 0;
        margin-right: 0.5rem;
    }

    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
}
