/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    padding: 20px;
}

.container {
    text-align: center;
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner Animation */
.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.countdown {
    font-size: 1.25rem;
    margin-top: 15px;
    opacity: 0.9;
    font-weight: 500;
}

/* Cancel Button */
.cancel-btn {
    display: none;
    margin-top: 30px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    background-color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    min-height: 44px;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background-color: #f0f0f0;
}

.cancel-btn:active {
    transform: translateY(0);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .countdown {
        font-size: 1.1rem;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    .cancel-btn {
        padding: 14px 36px;
        font-size: 1.05rem;
    }
}

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

    .countdown {
        font-size: 1rem;
    }

    .container {
        padding: 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #434343 0%, #000000 100%);
    }
}

/* No Script Message */
.noscript {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Accessibility */
.cancel-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Loading state for slow connections */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%);
    background-size: 1000px 100%;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer:hover {
    opacity: 1;
}

.footer p {
    margin: 0;
    font-weight: 400;
}

.footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.footer a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

@media (max-width: 480px) {
    .footer {
        font-size: 0.7rem;
        padding: 8px 15px;
    }
}
