/* ============================================
   TODITO PERÚ - SISTEMA DE TEMA GLOBAL
   Navidad 2025 - Premium Edition
   ============================================ */

/* ============================================
   VARIABLES - LIGHT MODE (DEFAULT)
   ============================================ */
:root {
    /* Colores principales */
    --primary: #b22234;
    --secondary: #d4af37;
    --accent-green: #1d4d2c;
    
    /* Textos */
    --text: #2c2c2c;
    --text-muted: #555;
    --text-light: #777;
    
    /* Fondos */
    --bg: #fefefe;
    --bg-gradient-start: #f8f9fa;
    --bg-gradient-mid: #ffffff;
    --bg-card: #ffffff;
    --bg-section: #fef9f9;
    
    /* Bordes y sombras */
    --border-color: rgba(212, 175, 55, 0.2);
    --border-light: #eee;
    --shadow-color: rgba(178, 34, 52, 0.1);
    --shadow-soft: rgba(0, 0, 0, 0.05);
    
    /* Efectos navideños */
    --snow-color: rgba(255, 255, 255, 0.9);
    --snow-shadow: rgba(180, 180, 180, 0.4);
    
    /* Switch */
    --switch-bg: #e8e8e8;
    --switch-handle: #ffffff;
    
    /* Footer */
    --footer-gradient: rgba(248, 249, 250, 0.5);
    
    /* Info boxes */
    --info-bg: #fff8e1;
    --info-border: var(--secondary);
    
    /* Contact box */
    --contact-bg: #f8f9fa;
}

/* ============================================
   VARIABLES - DARK MODE
   ============================================ */
[data-theme="dark"] {
    /* Colores principales */
    --primary: #e63946;
    --secondary: #ffd700;
    --accent-green: #4ade80;
    
    /* Textos */
    --text: #f0f0f0;
    --text-muted: #c0c0c0;
    --text-light: #a0a0a0;
    
    /* Fondos */
    --bg: #0d1117;
    --bg-gradient-start: #161b22;
    --bg-gradient-mid: #0d1117;
    --bg-card: #161b22;
    --bg-section: #1a1f26;
    
    /* Bordes y sombras */
    --border-color: rgba(255, 215, 0, 0.15);
    --border-light: #30363d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-soft: rgba(0, 0, 0, 0.2);
    
    /* Efectos navideños */
    --snow-color: rgba(255, 215, 0, 0.8);
    --snow-shadow: rgba(255, 215, 0, 0.3);
    
    /* Switch */
    --switch-bg: #2d333b;
    --switch-handle: #ffd700;
    
    /* Footer */
    --footer-gradient: rgba(22, 27, 34, 0.8);
    
    /* Info boxes */
    --info-bg: rgba(255, 215, 0, 0.1);
    --info-border: var(--secondary);
    
    /* Contact box */
    --contact-bg: #21262d;
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-start) 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease, color 0.3s ease;
    line-height: 1.7;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ============================================
   THEME TOGGLE SWITCH - "LIGHT SWITCH"
   ============================================ */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.theme-switch {
    position: relative;
    width: 70px;
    height: 36px;
    background: var(--switch-bg);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
}

.theme-switch::before {
    content: '☀️';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

.theme-switch::after {
    content: '🌙';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .theme-switch::before {
    opacity: 0.4;
}

[data-theme="dark"] .theme-switch::after {
    opacity: 1;
}

.theme-switch-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: var(--switch-handle);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-switch-handle {
    left: calc(100% - 29px);
    background: var(--switch-handle);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* ============================================
   CHRISTMAS ACCENT BAR
   ============================================ */
.christmas-accent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 30%, var(--accent-green) 50%, var(--secondary) 70%, var(--primary) 100%);
    z-index: 1001;
}

[data-theme="dark"] .christmas-accent {
    height: 2px;
    background: linear-gradient(90deg,
            #ff6b6b 0%,
            #ffd700 25%,
            #4ecdc4 50%,
            #ffd700 75%,
            #ff6b6b 100%);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ============================================
   SNOW EFFECT (LIGHT MODE)
   ============================================ */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: var(--snow-color);
    font-size: 1rem;
    text-shadow: 0 0 3px var(--snow-shadow);
    animation: fall linear infinite;
    opacity: 0.6;
}

@keyframes fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.5; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 18s; animation-delay: 0s; font-size: 0.5rem; }
.snowflake:nth-child(2) { left: 12%; animation-duration: 14s; animation-delay: 2s; font-size: 0.6rem; }
.snowflake:nth-child(3) { left: 22%; animation-duration: 20s; animation-delay: 4s; font-size: 0.4rem; }
.snowflake:nth-child(4) { left: 32%; animation-duration: 16s; animation-delay: 1s; font-size: 0.55rem; }
.snowflake:nth-child(5) { left: 42%; animation-duration: 19s; animation-delay: 3s; font-size: 0.5rem; }
.snowflake:nth-child(6) { left: 52%; animation-duration: 15s; animation-delay: 5s; font-size: 0.65rem; }
.snowflake:nth-child(7) { left: 62%; animation-duration: 21s; animation-delay: 2s; font-size: 0.45rem; }
.snowflake:nth-child(8) { left: 72%; animation-duration: 13s; animation-delay: 4s; font-size: 0.55rem; }
.snowflake:nth-child(9) { left: 82%; animation-duration: 17s; animation-delay: 1s; font-size: 0.5rem; }
.snowflake:nth-child(10) { left: 92%; animation-duration: 16s; animation-delay: 3s; font-size: 0.6rem; }

/* Dark mode: Golden sparkles instead of snow */
[data-theme="dark"] .snowflake {
    color: var(--snow-color);
    text-shadow: 0 0 8px var(--snow-shadow);
    animation-name: sparkle-fall;
}

@keyframes sparkle-fall {
    0% { transform: translateY(-10px) scale(0.8); opacity: 0; }
    10% { opacity: 0.8; }
    50% { transform: translateY(50vh) scale(1.2); opacity: 1; }
    90% { opacity: 0.6; }
    100% { transform: translateY(100vh) scale(0.8); opacity: 0; }
}

/* ============================================
   CHRISTMAS LIGHTS (DARK MODE)
   ============================================ */
.christmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

[data-theme="dark"] .christmas-lights {
    opacity: 1;
}

.light-string {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
}

.light-bulb {
    width: 8px;
    height: 12px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: glow 2s ease-in-out infinite;
    position: relative;
}

.light-bulb::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 6px;
    background: #444;
    border-radius: 2px 2px 0 0;
}

.light-bulb:nth-child(1) { background: #ff6b6b; box-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff6b6b; animation-delay: 0s; }
.light-bulb:nth-child(2) { background: #ffd700; box-shadow: 0 0 15px #ffd700, 0 0 30px #ffd700; animation-delay: 0.2s; }
.light-bulb:nth-child(3) { background: #4ecdc4; box-shadow: 0 0 15px #4ecdc4, 0 0 30px #4ecdc4; animation-delay: 0.4s; }
.light-bulb:nth-child(4) { background: #ff6b6b; box-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff6b6b; animation-delay: 0.6s; }
.light-bulb:nth-child(5) { background: #ffd700; box-shadow: 0 0 15px #ffd700, 0 0 30px #ffd700; animation-delay: 0.8s; }
.light-bulb:nth-child(6) { background: #4ecdc4; box-shadow: 0 0 15px #4ecdc4, 0 0 30px #4ecdc4; animation-delay: 1s; }
.light-bulb:nth-child(7) { background: #ff6b6b; box-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff6b6b; animation-delay: 1.2s; }
.light-bulb:nth-child(8) { background: #ffd700; box-shadow: 0 0 15px #ffd700, 0 0 30px #ffd700; animation-delay: 1.4s; }
.light-bulb:nth-child(9) { background: #4ecdc4; box-shadow: 0 0 15px #4ecdc4, 0 0 30px #4ecdc4; animation-delay: 1.6s; }
.light-bulb:nth-child(10) { background: #ff6b6b; box-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff6b6b; animation-delay: 1.8s; }

@keyframes glow {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Wire connecting bulbs */
.light-string::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #333 5%, #333 95%, transparent 100%);
}

/* ============================================
   LOGO STYLES
   ============================================ */
.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
    text-decoration: none;
}

.logo::before {
    content: '✦';
    color: var(--secondary);
    font-size: 0.8rem;
    animation: twinkle 2s ease-in-out infinite;
}

[data-theme="dark"] .logo::before {
    text-shadow: 0 0 10px var(--secondary);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ============================================
   HEADER GLOBAL
   ============================================ */
header {
    padding: 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    border-bottom: 1px solid var(--border-light);
    transition: border-color 0.3s ease;
}

/* ============================================
   FOOTER GLOBAL
   ============================================ */
footer {
    text-align: center;
    padding: 35px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-light);
    background: linear-gradient(180deg, transparent 0%, var(--footer-gradient) 100%);
    transition: all 0.3s ease;
}

footer p:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

footer p:first-child::before,
footer p:first-child::after {
    content: '❄';
    color: var(--secondary);
    font-size: 0.7rem;
    opacity: 0.6;
}

[data-theme="dark"] footer p:first-child::before,
[data-theme="dark"] footer p:first-child::after {
    content: '✨';
    text-shadow: 0 0 5px var(--secondary);
}

footer a {
    color: var(--primary);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary);
}

.holiday-wishes {
    margin-top: 15px;
    font-size: 0.75rem;
    color: var(--accent-green);
    opacity: 0.8;
    transition: color 0.3s ease;
}

[data-theme="dark"] .holiday-wishes {
    color: var(--secondary);
}

/* ============================================
   CARDS Y SECCIONES
   ============================================ */
.card,
.policy-section {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px var(--shadow-soft);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .card,
[data-theme="dark"] .policy-section {
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.02);
}

/* ============================================
   TÍTULOS
   ============================================ */
h1, h2, h3 {
    color: var(--text);
    transition: color 0.3s ease;
}

h1 span,
h2 {
    color: var(--primary);
    transition: color 0.3s ease;
}

[data-theme="dark"] h1 span,
[data-theme="dark"] h2 {
    text-shadow: 0 0 15px rgba(230, 57, 70, 0.2);
}

/* ============================================
   INFO BOXES
   ============================================ */
.info-box {
    background: var(--info-bg);
    border-left: 4px solid var(--info-border);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
}

[data-theme="dark"] .info-box {
    background: var(--info-bg);
    border-left-color: var(--secondary);
}

/* ============================================
   CONTACT BOX
   ============================================ */
.contact-box {
    background: var(--contact-bg);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .contact-box {
    border-color: var(--border-color);
}

/* ============================================
   NAVIGATION
   ============================================ */
.policy-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.policy-nav a {
    background: var(--contact-bg);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
}

.policy-nav a:hover,
.policy-nav a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

[data-theme="dark"] .policy-nav a {
    border-color: var(--border-color);
}

[data-theme="dark"] .policy-nav a:hover,
[data-theme="dark"] .policy-nav a.active {
    box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

/* ============================================
   WELCOME SECTION
   ============================================ */
.welcome-section {
    text-align: center;
    padding: 50px 20px 30px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-section) 100%);
    transition: background 0.3s ease;
}

.welcome-section h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================
   CHRISTMAS BADGE
   ============================================ */
.christmas-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(29, 77, 44, 0.1) 0%, rgba(212, 175, 55, 0.15) 100%);
    border: 1px solid var(--border-color);
    color: var(--accent-green);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

[data-theme="dark"] .christmas-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(230, 57, 70, 0.1) 100%);
    color: var(--secondary);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.christmas-badge span {
    color: var(--secondary);
}

[data-theme="dark"] .christmas-badge span {
    text-shadow: 0 0 8px var(--secondary);
}

/* ============================================
   PULSE ANIMATION (HEARTS, ETC)
   ============================================ */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.heart {
    color: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
}

[data-theme="dark"] .heart {
    text-shadow: 0 0 10px var(--primary);
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 600px) {
    .theme-toggle-container {
        top: 15px;
        right: 15px;
    }

    .theme-label {
        display: none;
    }

    .theme-switch {
        width: 60px;
        height: 32px;
    }

    .theme-switch-handle {
        width: 22px;
        height: 22px;
        top: 3px;
    }

    [data-theme="dark"] .theme-switch-handle {
        left: calc(100% - 25px);
    }

    .light-bulb {
        width: 6px;
        height: 10px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .welcome-section h1 {
        font-size: 1.8rem;
    }

    .policy-section,
    .card {
        padding: 20px;
    }

    .policy-nav a {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .snowflake,
    .logo::before,
    .light-bulb,
    .heart {
        animation: none;
    }

    .theme-switch-handle {
        transition: left 0.2s ease;
    }

    body,
    .card,
    .policy-section,
    a {
        transition: none;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

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

[data-theme="dark"]::-webkit-scrollbar-track {
    background: var(--bg);
}

[data-theme="dark"]::-webkit-scrollbar-thumb {
    background: var(--secondary);
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] ::selection {
    background: var(--secondary);
    color: var(--bg);
}
