/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f3f4f6;
    /* Light gray */
    color: #1f2937;
    /* Dark gray text */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    /* Default background before JS sets hourly class */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    --wind-speed: 5s;
}

/* Wind Sway Animation */
@keyframes windSway {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(3px, 2px) rotate(0.1deg);
    }

    50% {
        transform: translate(-2px, 3px) rotate(-0.1deg);
    }

    75% {
        transform: translate(4px, -1px) rotate(0.15deg);
    }
}

.windy {
    animation: windSway var(--wind-speed) ease-in-out infinite;
    will-change: transform;
}


/* Password Overlay */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.4);
    transition: opacity 0.8s ease, visibility 0.8s;
}

.password-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.password-card h2 {
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.password-card p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

#pass-input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    margin-bottom: 1.5rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#pass-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

#login-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

#login-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

#login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.85rem;
    display: none;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Base Fixes for main content transition */
#main-content {
    transition: opacity 1s ease-in-out;
}


/* Dynamic Background Transitions */
/* Clean Soft Mesh Gradient (Refined match to reference) */
body {
    background-color: #f3f4f6;
    /* Very light cool grey base */
    background-image:
        /* Large soft blue-indigo blob on the left */
        radial-gradient(at 0% 50%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        /* Large soft pink blob on the right center */
        radial-gradient(at 100% 50%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        /* Subtle top light glow */
        radial-gradient(at 50% 0%, rgba(255, 255, 255, 0.8) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: 100% 100%;
    color: #1e293b;
}

/* Override hourly classes to keep this static background */
body.h-0,
body.h-1,
body.h-2,
body.h-3,
body.h-4,
body.h-5,
body.h-6,
body.h-7,
body.h-8,
body.h-9,
body.h-10,
body.h-11,
body.h-12,
body.h-13,
body.h-14,
body.h-15,
body.h-16,
body.h-17,
body.h-18,
body.h-19,
body.h-20,
body.h-21,
body.h-22,
body.h-23 {
    background: inherit;
    /* Use the body's static background */
    color: inherit;
}

/* Dynamic Content Visuals based on Light/Dark context */
body.theme-light .quote-text {
    background: linear-gradient(to right, #1e293b, #475569);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-dark .quote-text {
    background: linear-gradient(to right, #f8fafc, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-dark .countdown-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-dark .c-value {
    color: #fcd34d;
}

body.theme-dark .c-label {
    color: #94a3b8;
}

body.theme-dark .progress-container {
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .progress-title {
    color: #cbd5e1;
}

/* Stars Effect Logic */
/* Stars Removed */

/* Redundant removal of old background globes */
.background-globes {
    display: none;
}

/* Main Container Fix */
.container {
    width: 90%;
    max-width: 800px;
    text-align: center;
    z-index: 10;
}

/* Slider Typography */
.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.quote-text {
    font-weight: 500;
    line-height: 1.6;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    gap: 1rem;
}

.quote-main {
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    color: #1e293b;
    max-width: 90%;
}

.quote-source {
    font-size: 0.85rem;
    font-weight: 400;
    color: #64748b;
    font-style: italic;
}

body.theme-dark .quote-main {
    color: #f1f5f9;
}

body.theme-dark .quote-source {
    color: #94a3b8;
}

/* Progress Section */
.progress-section {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #64748b;
    text-transform: uppercase;
    text-align: left;
}

.progress-container {
    width: 100%;
    height: 44px;
    background: #e2e8f0;
    border-radius: 22px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 4px;
    box-sizing: border-box;
}

.progress-fill {
    width: 16%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    position: relative;
    overflow: hidden;
    animation: struggle-width 3s infinite ease-in-out;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg) translateX(-150%);
    animation: shimmer 2s infinite;
}

@keyframes struggle-width {

    0%,
    100% {
        width: 16%;
    }

    50% {
        width: 16.5%;
    }
}

@keyframes shimmer {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    100% {
        transform: skewX(-20deg) translateX(200%);
    }
}

.progress-text {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    z-index: 2;
}

/* Countdown Section */
.countdown-main-container {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.countdown-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    font-weight: 600;
}

.countdown-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.countdown-container,
.slider-container,
.progress-container {
    transition: transform 0.3s ease;
}

.countdown-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    padding: 1.2rem 1.8rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.c-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #4338ca;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.c-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .countdown-card {
        padding: 0.8rem 1rem;
        min-width: 85px;
    }

    .c-value {
        font-size: 1.6rem;
    }
}

/* Fullscreen Button */
#fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #475569;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    color: #1e293b;
}

body.theme-dark #fullscreen-btn {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark #fullscreen-btn:hover {
    color: #f8fafc;
}