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

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0a0a1a; /* Fallback */
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    transition: background-image 1.5s ease;
}

.container {
    position: relative;
    z-index: 2; /* Above particles */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 0 15px;
    box-sizing: border-box;
}

.content-wrapper {
    background: rgba(0, 0, 0, 0.25);
    padding: 30px 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: 100%;
    max-width: 800px;
    min-height: 200px; /* Minimum height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    word-wrap: break-word;
}

#countdown {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    word-wrap: break-word;
}

#holiday-date {
    margin-top: 1rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Settings Icon */
.settings-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s ease;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

.settings-icon:hover {
    transform: rotate(45deg);
}

/* Popup */
.popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-wrapper.visible {
    opacity: 1;
    visibility: visible;
}

.popup {
    background-color: #2c2c2c;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.popup h2 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.popup .setting {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup label {
    font-size: 1rem;
    margin-right: 10px;
}

.popup select, .popup button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65rem;
    padding-right: 2.5rem;
    flex-shrink: 0;
}

.popup select {
    max-width: 180px;
}

.popup select option {
    background-color: #333333;
    color: #ffffff;
}

.popup button.full-width {
    width: 100%;
    margin-top: 10px;
}

.popup button.secondary {
    background-color: transparent;
    border: 1px solid #555;
}



/* --- Responsive Design --- */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 25px;
        min-height: 0;
    }

    h1 {
        font-size: 2.8rem;
    }

    #countdown {
        font-size: 1.6rem;
    }

    .settings-icon {
        top: 15px;
        right: 15px;
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.1rem;
    }

    #countdown {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .content-wrapper {
        padding: 20px 15px;
    }

    .popup .setting {
        flex-direction: column;
        align-items: flex-start;
    }

    .popup .setting label {
        margin-bottom: 8px;
        margin-right: 0;
    }

    .popup select {
        width: 100%;
        max-width: none;
    }
}

@media (min-width: 769px) {
    .content-wrapper {
        /* Allow the container to grow with its content */
        width: max-content;
        /* Set a minimum width to maintain the default size */
        min-width: 800px;
        /* Prevent the container from exceeding the screen width */
        max-width: 95vw;
    }
}

/* --- Animated Background --- */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
