/**
 * =========================================
 * TIMER - STYLES
 * Chilean flag colors + Professional design
 * =========================================
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Colors - Chilean flag */
    --blue: #0033A0;
    --red: #D52B1E;
    --white: #FFFFFF;
    --dark: #000d1a;
    --gray: #8892a1;

    /* Typography */
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --gap-xs: 0.5rem;
    --gap-sm: 1rem;
    --gap-md: 1.5rem;
    --gap-lg: 2rem;
    --gap-xl: 3rem;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--dark);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== BACKGROUND: IMAGE + OVERLAY ===== */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/Jose-Antonio-Kast-Rist.jpg');
    background-size: cover;
    background-position: center 20%;
    background-attachment: fixed;
    z-index: -2;
    filter: grayscale(20%) brightness(0.55);
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        160deg,
        rgba(0, 51, 160, 0.72) 0%,
        rgba(0, 13, 26, 0.88) 50%,
        rgba(213, 43, 30, 0.65) 100%
    );
    z-index: -1;
}

/* ===== MAIN CONTAINER ===== */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--gap-xl);
    padding: var(--gap-lg);
    position: relative;
    z-index: 1;
}

/* ===== HEADER / TITLE SECTION ===== */
.header-section {
    text-align: center;
    animation: fadeInDown 0.7s ease-out;
    max-width: 600px;
}

.pre-title {
    font-size: 0.75rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.title {
    font-family: var(--font-body);
    font-size: clamp(2.8rem, 9vw, 5rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.05;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.subtitle {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
    line-height: 1.2;
}

.name-highlight {
    color: var(--red);
    font-style: italic;
    font-weight: 700;
}

/* Chilean flag stripe */
.chile-flag-stripe {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 380px;
    height: 7px;
    margin: 1.5rem auto 1rem;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.stripe {
    flex: 1;
}

.stripe-red {
    background: var(--red);
}

.stripe-white {
    background: var(--white);
}

.stripe-blue {
    background: var(--blue);
}

.date-info {
    font-size: 0.9rem;
    color: var(--gray);
    letter-spacing: 1px;
    margin-top: 1rem;
    font-weight: 400;
}

/* ===== TIMER SECTION ===== */
.timer-section {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    width: 100%;
}

.timer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--gap-lg);
    border-radius: 20px;
    max-width: 100%;
}

/* ===== TIMER UNITS (Cards) ===== */
.timer-unit {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem 1rem 1rem;
    min-width: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(12px);
    transition: var(--transition-fast);
}

.timer-unit:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 51, 160, 0.5);
}

.timer-value {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    color: var(--white);
    line-height: 1;
    letter-spacing: 2px;
    text-shadow: 0 0 25px rgba(0, 51, 160, 0.8), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.timer-value.pulse {
    animation: pulse 0.4s ease-out;
}

.timer-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Separator between units */
.timer-sep {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--red);
    opacity: 0.8;
    align-self: center;
    padding-bottom: 1.8rem;
    animation: blink 1s step-start infinite;
}

/* ===== INFO SECTION ===== */
.info-section {
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.info-text {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: var(--white);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.info-text span {
    color: var(--red);
    font-weight: 800;
    font-size: 1.2em;
}

/* ===== ANIMATIONS ===== */
@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 pulse {
    0% {
        transform: scale(1.15);
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes blink {
    0%,
    49% {
        opacity: 0.3;
    }
    50%,
    100% {
        opacity: 1;
    }
}

/* ===== MEDIA QUERIES - RESPONSIVE ===== */

/* Mobile-first: < 768px */
@media (max-width: 767px) {
    .timer-sep {
        display: none;
    }

    .container {
        padding: var(--gap-sm);
        gap: var(--gap-lg);
    }

    .timer-container {
        gap: 0.6rem;
        padding: 1rem 0.75rem;
    }

    .timer-unit {
        flex: 0 0 calc(33.333% - 0.4rem);
        min-width: 0;
        padding: 1rem 0.5rem 0.75rem;
    }

    .timer-value {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .timer-label {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }

    .title {
        font-size: clamp(2.5rem, 7vw, 3.5rem);
    }

    .subtitle {
        font-size: clamp(1rem, 3vw, 1.5rem);
    }
}

/* Tablets */
@media (min-width: 768px) {
    .container {
        padding: var(--gap-lg);
        gap: var(--gap-xl);
    }

    .timer-container {
        flex-wrap: nowrap;
        gap: var(--gap-sm);
    }

    .timer-unit {
        min-width: 95px;
        padding: 1.5rem 1rem 1rem;
    }

    .title {
        font-size: clamp(3.5rem, 8vw, 5rem);
    }

    .subtitle {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
}

/* Large desktop */
@media (min-width: 1024px) {
    .container {
        gap: var(--gap-xl);
    }

    .timer-unit {
        min-width: 110px;
        padding: 2rem 1.25rem 1.25rem;
        border: 1px solid rgba(0, 51, 160, 0.3);
    }

    .timer-unit:hover {
        border-color: rgba(0, 51, 160, 0.6);
        box-shadow: 0 8px 24px rgba(0, 51, 160, 0.15);
    }

    .title {
        font-size: 5rem;
    }

    .subtitle {
        font-size: 2rem;
    }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--blue);
    border-radius: 4px;
}

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