/* Custom Styles for Server Time App */

/* Smooth transitions for theme changes */
* {
    transition-property: background-color, border-color;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

/* Remove transition delay for time display */
#timeDisplay,
#msDisplay,
#dateDisplay {
    transition: none;
}

/* Alarm button active state */
.alarm-btn.active {
    border-color: rgb(249, 115, 22);
    background: linear-gradient(to bottom right, rgb(255, 237, 213), rgb(254, 243, 199));
    color: rgb(194, 65, 12);
}

.dark .alarm-btn.active {
    background: linear-gradient(to bottom right, rgba(249, 115, 22, 0.2), rgba(245, 158, 11, 0.2));
    color: rgb(251, 146, 60);
}

/* Countdown background animation */
@keyframes countdownPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.countdown-urgent {
    animation: countdownPulse 1s ease-in-out infinite;
}

/* Red background for last 10 seconds */
.bg-countdown-warning {
    background: linear-gradient(to bottom right, rgb(254, 202, 202), rgb(254, 215, 170)) !important;
}

.dark .bg-countdown-warning {
    background: linear-gradient(to bottom right, rgba(239, 68, 68, 0.3), rgba(249, 115, 22, 0.2)) !important;
}

/* Canvas shadow for analog clock */
#analogClock {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.dark #analogClock {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: rgb(253, 186, 116);
    color: rgb(0, 0, 0);
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid rgb(249, 115, 22);
    outline-offset: 2px;
}

/* Mobile menu animation */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobileMenu.show {
    max-height: 200px;
}

/* Time flash animation for exact seconds */
@keyframes timeFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.time-flash {
    animation: timeFlash 0.2s ease-in-out;
}

/* Gradient text animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#timeDisplay {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #27272a 25%, #3f3f46 50%, #27272a 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: #18181b;
    color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.dark .toast {
    background: #fafafa;
    color: #18181b;
}

/* Progress bar shine effect */
#progressBar {
    position: relative;
    overflow: hidden;
}

#progressBar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    #timeDisplay {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    #msDisplay {
        font-size: 1.5rem;
    }

    .alarm-btn {
        padding: 0.75rem 0.5rem;
    }
}

/* Slide up animation for search results */
@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Print styles */
@media print {
    header, footer, .alarm-btn, #themeToggle {
        display: none !important;
    }

    #timeDisplay {
        color: black !important;
        -webkit-text-fill-color: black !important;
    }
}
