:root {
    --white: #ffffff;
    --brand-red: #EA1F27;
}

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

@keyframes pulse-glow {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(234, 31, 39, 0.6); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(234, 31, 39, 0.9), 0 0 10px rgba(234, 31, 39, 0.4) inset; }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(234, 31, 39, 0.6); }
}

@keyframes rise {
    0% { bottom: 0; opacity: 0; transform: translateX(0); }
    50% { opacity: 1; }
    100% { bottom: 100%; opacity: 0; transform: translateX(-5px); }
}

/* CHAMPAGNE STYLES */
.days-grid .holiday-today-pulse {
    position: relative;
    overflow: hidden; /* Contain bubbles */
    background: linear-gradient(135deg, rgba(234, 31, 39, 0.9), rgba(255, 215, 0, 0.3)) !important;
    border: 2px solid #FFD700 !important;
    /* Outer Golden Glow + Inner Glass Shine */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.4) !important;
    z-index: 5;
    color: #FFD700 !important; /* Gold Text */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Contrast against bubbles */
    font-weight: 800 !important;
}

/* Pseudo-elements acting as bubbles */
.holiday-today-pulse::before,
.holiday-today-pulse::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Start lower */
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    /* Create multiple clones using box-shadow */
    box-shadow: 
        10px 10px 0 rgba(255, 215, 0, 0.8), 
        -8px 15px 0 rgba(255, 255, 255, 0.6),
        5px 25px 0 rgba(255, 215, 0, 0.8);
    animation: rise 2s infinite ease-in;
}

.holiday-today-pulse::before {
    left: 20%;
    animation-duration: 2s;
    animation-delay: 0s;
}

.holiday-today-pulse::after {
    left: 60%;
    animation-duration: 2.5s;
    animation-delay: 1s;
    transform: scale(0.8); /* Varied size */
}

/* LOADER STYLES */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Premium "Spotlight" Gradient instead of flat black */
    background: radial-gradient(circle at center, rgba(35, 35, 35, 0.95) 0%, rgba(0, 0, 0, 1) 100%);
    backdrop-filter: blur(20px); /* Glass blur effect */
    -webkit-backdrop-filter: blur(20px);
    z-index: 2147483647;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 60px; /* Bigger */
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.4);
    border-top: 5px solid #EA1F27; /* Hardcoded Brand Red */
    border-radius: 50%;
    animation: spin 0.8s linear infinite; /* Faster spin */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes flip-coaster {
    0% {
        transform: perspective(1000px) rotateY(0deg);
    }
    50% {
        transform: perspective(1000px) rotateY(180deg);
        filter: blur(2px);
    }
    100% {
        transform: perspective(1000px) rotateY(360deg);
    }
}

.flip-animation {
    animation: flip-coaster 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    background-color: #000;
    -webkit-text-size-adjust: 100%;
    touch-action: none;
}

.calendar-container {
    height: 100vh; /* Fallback */
    height: 100dvh; /* Mobile browser fix */
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2vh 2vw;
    /* Add safe-area-inset for iPhone X+ navigation bar */
    padding-bottom: env(safe-area-inset-bottom, 20px); 
    z-index: 10;
}

.logo-top {
    margin-bottom: 2vh;
}

.logo {
    width: clamp(80px, 10vw, 120px);
    height: auto;
}

.calendar-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 25px 30px 10px 30px; 
    width: min(90vw, 420px);
    margin: auto auto 2vh auto;
    color: var(--white);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

#month-display {
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 10px;
}

.weekdays-grid, .days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}

.weekdays-grid .full {
    display: none;
}

.weekdays-grid .short {
    display: block;
}

.weekdays-grid {
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.days-grid div {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: default;
}

.days-grid .day:hover {
    background: rgba(255, 255, 255, 0.2);
}

.days-grid .today {
    background: var(--brand-red);
    color: var(--white);
    font-weight: 700;
    position: relative;
    z-index: 2;
    animation: pulse-glow 2.5s infinite ease-in-out;
}

.days-grid .empty {
    pointer-events: none;
}

.holiday-sidebar {
    display: none;
}

@media (max-width: 768px) {
    .overlay {
        padding: 2vh 3vw 1vh 3vw;
        /* Increase padding bottom slightly for aesthetic balance with home bar */
        padding-bottom: calc(2vh + env(safe-area-inset-bottom, 20px));
    }

    .calendar-card {
        margin-top: auto;
        margin-bottom: 2vh;
        width: 100%;
        max-width: 340px;
        padding: 10px 8px 5px 8px;
        border-radius: 16px;
        align-self: center;
    }
    
    .logo-top {
        align-self: flex-start;
        margin-bottom: 1.5vh;
    }

    .calendar-header {
        margin-bottom: 12px;
    }

    #month-display {
        font-size: 0.95rem;
    }

    .weekdays-grid {
        font-size: 0.75rem;
        margin-bottom: 4px;
        gap: 0px;
    }

    .weekdays-grid .short {
        display: block;
    }

    .weekdays-grid .full {
        display: none;
    }

    .days-grid {
        gap: 0px;
    }

    .days-grid div {
        font-size: 0.75rem;
        aspect-ratio: 1.1/1;
    }
    .nav-btn {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .overlay {
        padding: 2vh 1vw 1vh 1vw;
    }
    .calendar-container {
        background-position: center bottom;
    }
    .calendar-card {
        border-radius: 12px;
    }
}

@media (min-width: 769px) {
    .calendar-card {
        margin: auto auto 15px 15px;
        width: 90%;
        max-width: 480px;
        padding: 12px 18px 6px 18px;
        position: relative;
        overflow: visible;
    }

    .calendar-header {
        margin-bottom: 20px;
    }

    #month-display {
        font-size: 1.3rem;
        letter-spacing: 1.5px;
    }

    .weekdays-grid {
        font-size: 0.85rem;
        margin-bottom: 15px;
        opacity: 0.9;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        justify-items: center;
    }

    .weekdays-grid div {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .weekdays-grid .short {
        display: none;
    }

    .weekdays-grid .full {
        display: block;
        letter-spacing: 0px; 
        text-transform: uppercase;
        white-space: nowrap;
    }

    .holiday-sidebar {
        display: block;
        position: absolute;
        left: 100%;
        bottom: 15px;
        margin-left: 20px;
        width: 250px;
        text-align: left;
        font-size: 0.9rem;
        line-height: 1.6;
        color: rgba(255, 255, 255, 1);
        text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.8);
    }

    .holiday-item {
        margin-bottom: 5px;
    }

    .holiday-sidebar-active {
        color: #FFD700 !important;
        font-weight: 800;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
        transform: scale(1.1);
        transform-origin: left;
        transition: all 0.3s ease;
    }

    .days-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .days-grid div {
        aspect-ratio: 1.8 / 1;
        font-size: 0.9rem;
        border-radius: 8px;
    }
}
