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

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

h1 {
    color: #c82a2a;
    font-weight: 700;
    margin-bottom: 20px;
}

h2 {
    color: #2c5b2e;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
}

h3 {
    color: #333;
    margin-bottom: 10px;
}

#countdown-container {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#countdown-timer {
    font-size: 1.8em;
    font-weight: 700;
    color: #c82a2a;
}

#countdown-timer span {
    display: inline-block;
    min-width: 50px;
}

.deadline-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #555;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
}

button {
    background-color: #2c5b2e;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #3a7d3d;
}

button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.status-box {
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    margin: 20px 0;
}

.status-box.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.status-box.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.status-box.info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}


#result-display h2 {
    color: #c82a2a;
    border: none;
}

.gift-result {
    font-size: 2.5em;
    font-weight: 700;
    color: #d32f2f;
    padding: 20px;
    background-color: #fff3e0;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
}

.user-name-display {
    font-size: 1.2em;
    color: #555;
}

#gift-list-container {
    margin-top: 30px;
}

#gift-list {
    list-style-type: '🎁';
    padding-left: 20px; /* Adjust padding for flexbox alignment */
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Use gap for spacing between items */
    text-align: left;
}

#gift-list li {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 5px solid #3a7d3d;
    font-size: 1.2em;
    white-space: nowrap; /* Prevent text inside from wrapping */
}

/* --- Background Animation Styles --- */
#background-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place it behind all other content */
    pointer-events: none; /* Allow clicks to pass through */
    overflow: hidden;
}

.flying-text {
    position: absolute;
    color: #3a7d3d;
    opacity: 0.15;
    user-select: none; /* Prevent text selection */
    white-space: nowrap; /* Prevent text from wrapping */
}

@keyframes fly-left-to-right {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100vw);
    }
}

@keyframes fly-right-to-left {
    from {
        transform: translateX(100vw);
    }
    to {
        transform: translateX(-100%);
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    #countdown-timer {
        font-size: 1.5em;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px; /* Smaller gap between the two lines */
    }

    .countdown-line {
        display: flex;
        justify-content: center;
        align-items: baseline;
        gap: 5px; /* Gap between number and text */
    }

    #countdown-timer span {
        min-width: unset; /* Remove fixed min-width for flexibility */
        display: inline-block; /* Ensure they stay inline within the line */
        text-align: right; /* Align numbers */
    }

    .gift-result {
        font-size: 2em;
    }

    #gift-list {
        padding-left: 15px;
        gap: 10px;
    }

    #gift-list li {
        font-size: 1.1em;
    }
}
