* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #ff0000, #ff69b4, #8a2be2);
    background-size: 400% 400%;
    animation: gradientAnimation 10s ease infinite;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 24px;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 10%;
    padding: 0 20px;
    line-height: 1.3;
}

.container {
    text-align: center;
    background: white;
    padding: 28px 32px;
    border-radius: 16px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.container:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.12),
        0 14px 40px rgba(0, 0, 0, 0.18);
}

.upper-timer {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 8px;
}

.time {
    font-size: 24px;
    font-weight: bold;
    color: #ff1493;
    margin: 0 10px;
    padding: 8px 12px;
    background: rgba(255, 20, 147, 0.08);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.countdown {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
    letter-spacing: -1px;
}

.motd {
    font-size: 16px;
    color: #ffffff;
    margin-top: 24px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
}

.buttons {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 12px;
}

.icon-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.icon-button:active {
    transform: translateY(0);
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 10vh auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    border-radius: 16px;
    text-align: center;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.2),
        0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    flex: 0 0 auto;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.modal-body {
    flex: 1 1 auto;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.close {
    color: #999;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #333;
}

/* Simple modal content (info, settings) */
#infoModal .modal-content,
#settingsModal .modal-content,
#fetchingModal .modal-content {
    padding: 24px;
    display: block;
    max-height: none;
}

#infoModal .close,
#settingsModal .close {
    position: static;
    float: right;
    transform: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-left: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    transition: .3s ease;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
    background-color: #ff69b4;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Events list styling */
#eventsList {
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
}

#eventsList::-webkit-scrollbar {
    width: 6px;
}

#eventsList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#eventsList::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#eventsList::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.event {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 4px solid #ff69b4;
    text-align: left;
    transition: background 0.2s ease, transform 0.2s ease;
}

.event:hover {
    background: #f5f5f5;
    transform: translateX(2px);
}

.event:last-child {
    margin-bottom: 0;
}

.event.past-event {
    border-left-color: #ccc;
    opacity: 0.75;
}

.event h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #333;
}

.event p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.event.past-event p {
    color: #999;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .header {
        font-size: 24px;
        top: 5%;
    }
    
    .container {
        padding: 20px;
    }
    
    .countdown {
        font-size: 36px;
    }
    
    .time {
        font-size: 18px;
        padding: 6px 8px;
        margin: 0 4px;
    }
    
    .upper-timer {
        flex-wrap: wrap;
        justify-content: center;
    }
}

