@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

/* Webkit scrollbar styles (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

::-webkit-scrollbar-track {
    background: rgba(5, 5, 6, 0.05);
    border-radius: 1rem;
}

::-webkit-scrollbar-thumb {
    background: rgba(189, 255, 215, 0.5);
    border-radius: 1rem;
}

/* Hide scrollbar buttons */
::-webkit-scrollbar-button {
    display: none;
}

/* Firefox scrollbar styles */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(189, 255, 215, 0.5) rgba(5, 5, 6, 0.05);
}

* {
    font-family: 'Nunito', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(160deg, #050506, #3d4244);
    position: relative;
    overflow: hidden;
}

/* Animated snow effect */
.christmas-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1.5px, transparent 1.5px),
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 2px, transparent 2px),
        radial-gradient(white 1px, transparent 1px);
    background-size: 
        37px 37px,
        61px 59px,
        67px 67px,
        83px 83px,
        71px 71px;
    background-position: 
        0 0,
        13px 17px,
        -7px 13px,
        17px 9px,
        -13px -17px;
    animation: 
        snow 20s linear infinite,
        fade 8s ease-in-out infinite;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    will-change: background-position, opacity;
}

@keyframes snow {
    0% { 
        background-position: 
            0 0,
            13px 17px,
            -7px 13px,
            17px 9px,
            -13px -17px;
    }
    100% { 
        background-position: 
            500px 1000px,
            513px 1017px,
            493px 1013px,
            517px 1009px,
            487px 983px;
    }
}

@keyframes fade {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.christmas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-width: 100vw;
    padding: 20px 0;
    background: linear-gradient(160deg, #050506, #3d4244);
    position: relative;
    overflow-y: auto;
    width: 100vw;
    box-sizing: border-box;
}

/* Update media queries to maintain full viewport coverage */
@media screen and (max-height: 700px) {
    .christmas-container {
        min-height: 100vh;
        padding: 40px 0;
    }
    
    .content {
        margin: 20px auto;
    }
}

.content {
    text-align: center;
    /* Frosted glass effect with gradient overlay */
    background: linear-gradient(
        160deg,
        #81b8b7ef 0%,
        rgba(255, 255, 255, 0.885) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.2rem;
    border-radius: 20px;
    /* Layered shadows for depth */
    box-shadow: 
        0 0 30px rgba(194, 233, 255, 0.216),
        inset 0 0 20px rgba(17, 49, 52, 0.1),
        0 0 30px rgba(10, 21, 23, 0.666);
    position: relative;
    /* Subtle winter border */
    border: 4px solid #ffffff;
    font-family: 'Nunito', sans-serif;
    margin: 0 auto;
    max-width: 60vw;
    min-width: min(300px, 75vw);  /* Responsive min-width */
    /* Add global height control */
    max-height: 90vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    z-index: 3;
}

/* Update text colors for better contrast */
.content h1 {
    color: rgba(189, 255, 215, 0.973);
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.503);
}

.content p {
    color: rgba(56, 73, 70, 0.97);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Base styles for larger screens */
@media screen and (min-width: 451px) {
    .content {
        max-width: 60vw;
    }
}

/* Tablet screens */
@media screen and (min-width: 451px) and (max-width: 1024px) {
    .content {
        min-width: min(300px, 60vw);
    }
}

/* Desktop sizes */
@media screen and (min-width: 1025px) and (max-width: 1439px) {
    .content {
        min-width: min(300px, 30vw);
        max-width: 40vw;
    }
}

@media screen and (min-width: 1440px) {
    .content {
        min-width: min(300px, 30vw);
        max-width: 30vw;
    }
}

/* iPhone SE and similar tiny screens */
@media screen and (max-width: 359px) and (max-height: 670px) {
    .christmas-container {
        min-height: auto;
        padding: 0;
    }
    
    .content {
        max-width: 75%;
        min-width: auto;
        padding: 1rem;
        margin: auto;
    }
}

/* Priority styles for 360-450px screens */
@media screen and (min-width: 300px) and (max-width: 450px) {
    .christmas-container {
        min-height: 100vh;
        align-items: flex-start;
    }
    
    .content {
        max-width: 80vw;
        margin-top: 10vh;
    }
}

h1 {
    color: rgba(242, 255, 208, 0.973);
    font-size: 2.1rem;
    margin-bottom: 0.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    text-transform: uppercase;
    font-weight: 700;
}

h2 {
    color: #fafff3;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

p {
    color: #2b3231;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.christmas-btn {
    display: inline-flex;
    background: linear-gradient(145deg, #c41e37eb, #8e133ee0);
    color: white;
    padding: calc(0.5em + 0.5vw) calc(1em + 0.5vw);
    border-radius: 3.125em;
    text-decoration: none;
    font-size: clamp(0.8em, 2vw, 1em);
    transition: all 0.3s ease;
    border: .25rem solid rgb(252 201 223);
    cursor: pointer;
    box-shadow: 0 0.25em 0.9375em rgba(117, 43, 56, 0.68);
    font-weight: 700;
    margin: 0;
    width: auto;
    min-width: 5em;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    height: fit-content;
    line-height: 1.2;
    will-change: transform, box-shadow;
}

.christmas-btn:hover {
    background: linear-gradient(145deg, #a01830, #c41e3a);
    transform: translateY(-3px);
    box-shadow: 0 0.375em 1.25em rgba(196, 30, 58, 0.4);
}

.christmas-btn i {
    margin-right: 10px;
}

/* Update Christmas lights effect */
@keyframes twinkle-red {
    0%, 100% { opacity: 0.3; filter: drop-shadow(0 0 0.125rem rgba(231, 26, 98, 0.4)); }
    50% { opacity: 1; filter: drop-shadow(0 0 0.3rem rgba(231, 26, 98, 0.8)); }
}

@keyframes twinkle-green {
    0%, 100% { opacity: 0.3; filter: drop-shadow(0 0 0.125rem rgba(31, 188, 123, 0.4)); }
    50% { opacity: 1; filter: drop-shadow(0 0 0.3rem rgba(31, 188, 123, 0.8)); }
}

@keyframes twinkle-white {
    0%, 100% { opacity: 0.4; filter: drop-shadow(0 0 0.125rem rgba(255, 255, 255, 0.4)); }
    40% { opacity: 1; filter: drop-shadow(0 0 0.3rem rgba(255, 255, 255, 0.8)); }
}

@keyframes twinkle-blue {
    0%, 100% { opacity: 0.4; filter: drop-shadow(0 0 0.125rem rgba(21, 88, 196, 0.4)); }
    30% { opacity: 1; filter: drop-shadow(0 0 0.3rem rgba(21, 88, 196, 0.8)); }
}

/* Add new super bright twinkle animation */
@keyframes super-twinkle {
    0%, 100% { 
        opacity: 0.3; 
        filter: drop-shadow(0 0 0.2rem rgba(255, 255, 255, 0.8))
               drop-shadow(0 0 0.4rem rgba(255, 255, 255, 0.6))
               drop-shadow(0 0 0.6rem rgba(255, 255, 255, 0.4))
               drop-shadow(0 0 1rem rgba(255, 255, 255, 0.2));
    }
    50% { 
        opacity: 1; 
        filter: drop-shadow(0 0 0.3rem rgba(255, 255, 255, 1))
               drop-shadow(0 0 0.6rem rgba(255, 255, 255, 0.9))
               drop-shadow(0 0 1rem rgba(255, 255, 255, 0.8))
               drop-shadow(0 0 1.5rem rgba(255, 255, 255, 0.7))
               drop-shadow(0 0 2rem rgba(255, 255, 255, 0.6))
               brightness(1.5);
    }
}

.christmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5rem;
    z-index: 2;
    display: flex;
}

/* Base lights pattern - using radial gradients for teardrop shape */
.christmas-lights::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 0, rgb(231 26 98 / 80%) 0.25rem, transparent 0.5rem),
        radial-gradient(circle at 50% 0, rgba(31, 188, 123, 0.8) 0.25rem, transparent 0.5rem),
        radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.8) 0.25rem, transparent 0.5rem),
        radial-gradient(circle at 50% 0, rgba(21, 88, 196, 0.8) 0.25rem, transparent 0.5rem);
    background-size: 3rem 1.5rem;  /* Changed from 48px 24px */
    background-position: 0 0, 0.75rem 0, 1.5rem 0, 2.25rem 0;  /* Changed from px values */
    background-repeat: repeat-x;
    filter: drop-shadow(0 0 0.3rem rgba(255, 255, 255, 0.3));
    animation: twinkle-red 1s infinite;
    will-change: opacity, filter;
}

.christmas-lights::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0.75rem;  /* Changed from 12px */
    right: 0;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 0, rgb(231 26 98 / 75%) 0.25rem, transparent 0.5rem),
        radial-gradient(circle at 50% 0, rgba(31, 188, 123, 0.75) 0.25rem, transparent 0.5rem),
        radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.75) 0.25rem, transparent 0.5rem),
        radial-gradient(circle at 50% 0, rgba(21, 88, 196, 0.75) 0.25rem, transparent 0.5rem);
    background-size: 3rem 1.5rem;
    background-position: 0 0, 0.75rem 0, 1.5rem 0, 2.25rem 0;
    background-repeat: repeat-x;
    filter: drop-shadow(0 0 0.3rem rgba(255, 255, 255, 0.3));
    animation: twinkle-green 1.1s infinite 0.1s;
    will-change: opacity, filter;
}

/* Add bright twinkle spots with enhanced glow */
.christmas-lights .twinkle-spot {
    content: '';
    position: absolute;
    top: 0;
    height: 1.5rem;  /* Changed from 24px */
    width: 0.5rem;   /* Changed from 8px */
    animation: super-twinkle 3s infinite;
    opacity: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 50% 0, currentColor 0.25rem, transparent 0.5rem);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    will-change: opacity, filter;
}

.christmas-lights .twinkle-spot:nth-child(1) {
    color: rgb(255, 255, 255);  /* Use color instead of background for gradient */
    left: calc(var(--random-position-1, 30%));
    animation-delay: calc(var(--random-delay-1, 0.5) * 1s);
}

.christmas-lights .twinkle-spot:nth-child(2) {
    color: rgb(31, 188, 123);  /* Use color instead of background for gradient */
    left: calc(var(--random-position-2, 70%));
    animation-delay: calc(var(--random-delay-2, 1.5) * 1s);
}

/* Music Player Container - Update background */
.music-player {
    transition: all 0.3s ease;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    background: linear-gradient(145deg, #c41e37eb, #8e133ee0); /* Updated to red gradient */
    padding: 0.6rem;
    border-radius: 1.25rem;
    box-shadow: 
        0 0 1.875rem rgba(194, 233, 255, 0.216),
        inset 0 0 1.25rem rgba(17, 49, 52, 0.1),
        0 0 1.875rem rgba(10, 21, 23, 0.666);
    z-index: 100;
    max-width: 45vw;
    border: 0.25rem solid #ffffff;
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    will-change: transform, opacity;
}

.music-player.password-confirming {
    bottom: auto;
    top: 1.25rem;
    right: 1.25rem;
    transition: all 0.5s ease;
}

/* Update player header - remove background */
.player-header {
    display: flex;
    justify-content: flex-end;
    gap: 0.3125rem;
    padding: 0.125rem;
    margin-bottom: 0.3125rem;
    align-items: center;
    cursor: grab;
    background: none; /* Removed gradient background */
    border-radius: 0.625rem;
}

/* Update music controls background */
.music-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3%;
    padding: 3%;
    margin: auto;
    width: 94%;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.625rem;
}

@media screen and (max-width: 770px) {
    .music-controls {
        gap: 3%;
        padding: 3%;
        margin: auto;
        width: 94%;
    }
}

/* Update player title color for better contrast */
.player-title {
    margin-right: auto;
    color: rgba(255, 255, 255, 0.973);
    text-shadow: 0.125rem 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

/* Update current song text color and width */
#currentSong {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0.0625rem 0.0625rem 0.125rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    will-change: transform;
}

@media screen and (max-width: 770px) {
    #currentSong {
        font-size: 1rem;
        margin-left: 0.3125rem;
        margin-top: 0.5rem;
    }
}

/* Update media queries for responsive design */
@media screen and (max-width: 770px) {
    .music-player:not(.minimized) {
        width: 85vw;
        max-width: 85vw;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        border-radius: 1.25rem;
        padding: 1rem;
    }

    #volumeSlider {
        width: 6.25rem;
        height: 1.25rem;
    }

    #currentSong {
        font-size: 1rem;
        margin-left: 0.3125rem;
        margin-top: 0.5rem;
    }

    .music-player.minimized {
        width: auto;
        right: 1.25rem;
        border-radius: 1.25rem;
        transform: none;
        left: auto;
    }
}

.player-control {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.125rem 0.3125rem;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.player-control:hover {
    color: #ffffff;
    transform: scale(1.1);
    text-shadow: 0 0 0.625rem rgba(255, 255, 255, 0.5);
}

.music-controls button {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin: 0 0.3125rem;
}

.music-controls button:hover {
    color: #ffffff;
    transform: scale(1.1);
    text-shadow: 0 0 0.625rem rgba(255, 255, 255, 0.5);
}

#volumeSlider {
    accent-color: #ffffff;
    width: 3.75rem;
    height: 0.25rem;
    border-radius: 0.125rem;
}

.error-message {
    background-color: #ffebee;
    color: #c41e3a;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 4px;
    border: 1px solid #ffcdd2;
    font-size: 0.8rem;
}

.success-message {
    background-color: #e8f5e9;
    color: #2a6339;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 4px;
    border: 1px solid #c8e6c9;
    font-size: 0.8rem;
}

.instructions {
    font-size: 1.5rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.login-message {
    margin-top: 1rem;
    color: #c41e3a;
    font-weight: bold;
    min-height: 1.5em;
}

/* Hide footer */
footer, sticky-header {
    display: none !important;
}

/* Password form styles */
.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;  /* Match our smaller font sizes */
}

.form-input:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 5px rgba(196, 30, 58, 0.2);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #ef0d5bba;
    font-weight: bold;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px;
    height: 100%;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: #c41e3a;
}

.password-requirements {
    font-size: .9rem;
    color: rgba(56, 73, 70, 0.97);
    margin: .75em;
    text-align: left;
    font-weight: bold;
}

.requirements-heading {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.requirements-heading.valid {
    color: rgba(206, 255, 225, 0.973);
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(141, 201, 158, 0.547),
        2px 2px 4px rgba(26, 39, 29, 0.503);
    font-size: 0.8rem;
    margin-bottom: 0;
}

.password-requirements ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    padding-left: 0;
    list-style: none;
    margin: 0.25rem 0;
    transition: all 0.3s ease;
}

.password-requirements li {
    display: flex;
    align-items: center;
    padding: 0.1rem 0;
    color: rgb(231 26 98 / 90%);
    font-weight: normal;
    transition: color 0.3s ease;
    font-size: 0.75rem;
}

.password-requirements li.valid {
    color: rgba(206, 255, 225, 0.973);
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(141, 201, 158, 0.547),
        2px 2px 4px rgba(26, 39, 29, 0.503);
}

.password-form .validation-icon {
    font-size: 0.5rem;
    margin-right: 0.25rem;
} 

.password-match.valid {
    color: rgba(206, 255, 225, 0.973);  /* Bright green for met requirements */
    font-weight: bold;
    text-shadow: 
    0 0 10px rgba(141, 201, 158, 0.547),
    2px 2px 4px rgba(26, 39, 29, 0.503);
    margin: .75em;
    font-size: 1.15rem;
}

.password-match.invalid {
    color: rgb(231 26 98 / 90%);
    margin: .75em;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.login-options {
    text-align: center;
    margin: 2rem 0;
}

.login-form {
    max-width: 300px;
    margin: 1rem auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.login-form .form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-form .input-container {
    width: 90%;
    position: relative;
    display: flex;
    align-items: center;
}

.login-form input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.9rem;
}

.login-form label {
    width: 90%;
    text-align: left;
    margin-bottom: 0.5rem;
    color: #ef0d5bba;
    font-weight: bold;
}

.login-form input:focus {
    border-color: #c41e3a;
    outline: none;
    box-shadow: 0 0 5px rgba(196, 30, 58, 0.2);
}

.login-form .password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px;
    height: 100%;
    display: flex;
    align-items: center;
}

.login-form .password-toggle:hover {
    color: #c41e3a;
}

.close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #c41e3a;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    transform: scale(1.1);
    color: #a01830;
}

/* Add specific styles for iPhone SE and similar small screens */
@media screen and (max-width: 380px) and (max-height: 670px) {
    .christmas-container {
        min-height: auto;
        padding: 0;
    }
    
    .content {
        max-width: 75%;
        min-width: auto;
        padding: 1rem;
        margin: auto;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .christmas-btn {
        padding: 10px 20px;
        margin: 0.5rem;
        min-width: 180px;
    }
}

.music-player.minimized .music-controls {
    display: none;
}

.music-player.minimized .player-header #playPauseBtn {
    display: inline-flex;
    order: 1;
    margin: 0 5px;
}

.music-player.minimized .player-title {
    order: 0;
}

.music-player.minimized .player-control.maximize {
    order: 2;
}

.music-player.minimized .player-control.close {
    order: 3;
}

.reopen-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 1s;
}

.reopen-player .player-control {
    background: linear-gradient(145deg, #c41e37eb, #8e133ee0);
    border: 0.25rem solid #ffffff;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 1.875rem rgba(194, 233, 255, 0.216),
        inset 0 0 1.25rem rgba(17, 49, 52, 0.1),
        0 0 1.875rem rgba(10, 21, 23, 0.666);
    position: relative;
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
}

.reopen-player .player-control:hover {
    background: linear-gradient(145deg, #a01830, #c41e3a);
    transform: translateY(-0.1875rem);
    box-shadow: 
        0 0 2rem rgba(196, 30, 58, 0.4),
        inset 0 0 1.25rem rgba(17, 49, 52, 0.2);
}

.reopen-player .player-control i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(3rem * 0.5);
    color: rgba(255, 255, 255, 0.9);
}

@media screen and (max-width: 770px) {
    .reopen-player .player-control {
        width: 15vw;
        height: 15vw;
        max-width: 5rem;
        max-height: 5rem;
    }

    .reopen-player .player-control i {
        font-size: calc(15vw * 0.5);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 1s forwards;
}

.fade-in {
    animation: fadeIn 1s forwards;
}

.music-popup {
    opacity: 1;
    transition: opacity 1s;
}

.reopen-player {
    opacity: 1;
    transition: opacity 1s;
}

/* Add media query for phone screens */
@media screen and (max-width: 770px) {
    .reopen-player .player-control {
        width: 15vw;
        height: 15vw;
        max-width: 5rem;
        max-height: 5rem;
    }

    .music-player:not(.minimized) {
        width: 85vw;
        max-width: 85vw;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        border-radius: 20px;
        padding: 1rem;
    }

    /* Make all control buttons bigger on mobile */
    .player-control,
    .music-controls button {
        font-size: 1.3rem;
        padding: 0.5rem 0.75rem;
    }

    .player-title {
        font-size: 1.3rem;
        padding: 0.3rem;
    }

    /* Make volume slider bigger */
    #volumeSlider {
        width: 100px;
        height: 20px;
    }

    /* Adjust the current song text for better fit */
    #currentSong {
        font-size: 1rem;
        margin-left: 5px;
        margin-top: 8px;
    }
    /* Keep minimized player compact */
    .music-player.minimized {
        width: auto;
        right: 20px;
        border-radius: 20px;
        transform: none;
        left: auto;
    }

    /* Hide title when minimized on mobile */
    .music-player.minimized .player-title {
        display: none;
    }

    /* Adjust music popup width on mobile */
    .music-popup-content {
        width: 85vw;
        max-width: 85vw;
    }
}

/* Specific styles for narrow mobile screens */
@media screen and (min-width: 300px) and (max-width: 450px) {
    .christmas-container {
        align-items: flex-start;
    }
    
    .content {
        max-width: 80vw;
        margin-top: 10vh;  /* Position 20% down from the top of viewport */
    }
}

@media screen and (max-height: 800px) {
    .christmas-container {
        align-items: flex-start;
        padding: 0;
    }
    
    .content {
        max-height: 90vh;
        overflow-y: auto;
        padding: 1rem;
    }
}

@media screen and (max-height: 800px) {
    .content {
        padding: 0.8rem;
    }
    
    .form-group {
        margin-bottom: 0.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .password-requirements {
        margin: 0.5em;
    }
    
    .button-group {
        margin: 0.5rem 0;
    }
}

@media screen and (max-height: 800px) {
    .content {
        display: flex;
        flex-direction: column;
    }
    
    .password-form {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .password-requirements {
        flex-shrink: 1;
        min-height: 0;
    }
}

/* Specific styles for password form on smaller screens */
@media screen and (max-height: 940px) and (max-width: 450px) {
    .christmas-container .content.has-password-form {
        display: flex;
        flex-direction: column;
        width: 85vw;
        max-width: 85vw;
        height: auto;  /* Let it grow naturally */
        max-height: 85vh;
        margin: 0 auto;
        padding: 1rem;
    }

    .christmas-container.has-password-form {
        align-items: center;  /* Center vertically */
        padding: 0;
        min-height: 100vh;
    }

    .content.has-password-form .form-input {
        padding: 0.3rem;
        font-size: 1.75rem;  /* Larger font size for inputs */
    }
}

/* Specific styles for tablets with shorter heights (like Nest Hub) */
@media screen and (max-width: 1024px) and (max-height: 700px) {
    .christmas-container .content.has-password-form {
        padding: 0.6rem;
        height: auto;  /* Let it grow naturally */
        min-height: min-content;  /* Ensure it takes minimum required height */
        max-height: 85vh;  /* Don't let it get too tall */
        overflow-y: visible;  /* Prevent scrolling */
    }

    .content.has-password-form h2 {
        margin-bottom: 0.2rem;
    }

    .content.has-password-form p {
        margin-bottom: 0.2rem;
    }

    .content.has-password-form .form-input {
        padding: 0.25rem;
        font-size: 1.75rem;
    }
}

/* Base centering fix for all screens */
.christmas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-width: 100vw;
    padding: 0;
    position: relative;
    overflow-y: auto;
}

/* Adjust text margins when password form is present */
.content.has-password-form h2 {
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

.content.has-password-form p {
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

/* Specific styles for password form on smaller screens */
@media screen and (max-height: 940px) and (max-width: 450px) {
    .christmas-container .content.has-password-form {
        display: flex;
        flex-direction: column;
        width: 85vw;
        max-width: 85vw;
        height: auto;  /* Let it grow naturally */
        max-height: 85vh;
        margin: 0 auto;
        padding: 1rem;
    }
}

/* Specific styles for tablets with shorter heights (like Nest Hub) */
@media screen and (max-width: 1024px) and (max-height: 700px) {
    .christmas-container .content.has-password-form {
        padding: 0.6rem;
        height: auto;  /* Let it grow naturally */
        min-height: min-content;  /* Ensure it takes minimum required height */
        max-height: 85vh;  /* Don't let it get too tall */
        overflow-y: visible;  /* Prevent scrolling */
    }

    .content.has-password-form h2 {
        margin-bottom: 0.2rem;
    }

    .content.has-password-form p {
        margin-bottom: 0.2rem;
    }

    .content.has-password-form .form-input {
        padding: 0.25rem;
        font-size: 1.75rem;
    }
}

.content.has-password-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #ef0d5bba;
    font-weight: bold;
}

#confirm-label.valid {
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#confirm-label.invalid {
    color: #f44336;
    font-weight: bold;
}

#password-label.valid {
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#password-label.invalid {
    color: #f44336;
    font-weight: bold;
}

/* Add these styles for music player positioning */
.music-player.password-confirming {
    position: fixed;
    top: 20px;
    right: 20px;
    transition: all 0.5s ease;
}

.music-player {
    transition: all 0.5s ease;
}

/* Update spring animations for better timing and flow */
@keyframes springTransform {
    0% { 
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
    40% {
        transform: translate(calc(100vw - 120%), 2rem) scale(0.8);
        opacity: 0.8;
    }
    70% {
        transform: translate(calc(100vw - 110%), 3rem) scale(0.4);
        opacity: 0.4;
    }
    100% { 
        transform: translate(calc(100vw - 100%), 3.5rem) scale(0.001);
        opacity: 0;
    }
}

@keyframes headphoneAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    75% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ensure animations have proper timing */
.music-popup.spring-out {
    animation: springTransform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    position: fixed;
    left: 50%;
    bottom: 2vh;
    transform-origin: center center;
    will-change: transform, opacity;
}

.reopen-player.spring-in {
    animation: headphoneAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.3s; /* Start after spring-out completes */
    will-change: transform, opacity;
}

/* Ensure proper z-index stacking */
.music-popup {
    z-index: 1000;
}

.reopen-player {
    z-index: 999;
}

/* Add transition for password form integration */
.music-player {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-player.password-confirming {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide header play button by default */
#headerPlayPauseBtn {
    display: none;
}

/* Show header play button and hide controls play button when minimized */
.music-player.minimized #headerPlayPauseBtn {
    display: inline-flex;
    order: 1;
    margin: 0 5px;
}

.music-player.minimized .music-controls {
    display: none;
}

/* Keep controls group flex layout */
.player-controls-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Hide header play button by default */
#headerPlayPauseBtn {
    display: none;
}

/* Show header play button and hide controls play button when minimized */
.music-player.minimized #headerPlayPauseBtn {
    display: inline-flex;
    margin: 0 5px;
}

.music-player.minimized .music-controls {
    display: none;
}

/* Ensure button order in minimized state */
.music-player.minimized .player-controls-group #headerPlayPauseBtn {
    order: 1;
}

.music-player.minimized .player-controls-group #minimizeBtn {
    order: 2;
}

.music-player.minimized .player-controls-group #closeBtn {
    order: 3;
}

.music-popup {
    position: fixed;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #c41e37eb, #8e133ee0);
    padding: 1.2rem;
    border-radius: 1.25rem;
    box-shadow: 
        0 0 1.875rem rgba(194, 233, 255, 0.216),
        inset 0 0 1.25rem rgba(17, 49, 52, 0.1),
        0 0 1.875rem rgba(10, 21, 23, 0.666);
    z-index: 100;
    max-width: 90%;
    border: 0.25rem solid #ffffff;
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    color: white;
    text-align: center; /* Center text */
}

.music-popup h2,
.music-popup p {
    color: rgba(255, 255, 255, 0.973);
    text-shadow: 0.125rem 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
    margin: 0.5rem auto; /* Center with auto margins */
    text-align: center; /* Ensure text is centered */
}

.music-popup .button-group {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow buttons to wrap on very small screens */
}

/* Song title container and animation */
.song-title-container {
    overflow: hidden;
    width: 36%;
    white-space: nowrap;
    position: relative;
}

#currentSong {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0.0625rem 0.0625rem 0.125rem rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    display: inline-block;
    padding-right: 1rem;
    will-change: transform;
}

/* Song title scrolling animation */
@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Move exactly one unit (• Title •) which is 1/5 of total width */
        transform: translateX(-19%);
    }
}

.music-player:not(.minimized) #currentSong {
    animation: scrollText 15s linear infinite;
    transform: none;
    will-change: transform;
}

@media screen and (max-width: 770px) {
    .song-title-container {
        max-width: 40%;
    }
    
    #currentSong {
        font-size: 1rem;
        margin-left: 0.3125rem;
        margin-top: 0.5rem;
    }
        /* When minimized, adjust title container */
    .music-player.minimized .song-title-container {
        display: none;
    }
}


