/**
 * TimeZone Converter - Main Stylesheet
 */

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

/* Ad Containers - explicit sizing independent of Tailwind */
.ad-container {
    display: block;
    width: 100%;
    min-height: 1px;
    overflow: hidden;
}
.ad-container.sidebar-ad {
    width: auto;
    min-width: 300px;
}
.ad-container.mobile-footer-ad {
    width: auto;
    min-width: 320px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--b2));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--p));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--pf));
}

/* Ad Containers */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    margin: 1rem 0;
}

.ad-container.header-ad {
    min-height: 90px;
}

.ad-container.sidebar-ad {
    min-height: 250px;
}

.ad-container.content-ad {
    min-height: 280px;
}

.ad-container.mobile-footer-ad {
    min-height: 50px;
    background: hsl(var(--b1));
    padding: 5px 0;
}

/* Time Display */
.time-display {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

/* Smooth Transitions */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* Form Controls */
select, input[type="datetime-local"], input[type="date"] {
    cursor: pointer;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
}

/* Theme Toggle Animation */
#theme-toggle {
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(180deg);
}

/* World Clock Cards */
[data-timezone] {
    transition: color 0.3s ease;
}

/* Copy Button */
.copy-btn {
    position: relative;
    overflow: hidden;
}

.copy-btn::after {
    content: 'Copied!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: hsl(var(--su));
    color: hsl(var(--suc));
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.copy-btn.copied::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid hsl(var(--p));
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Back to Top Button */
#back-to-top {
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

#back-to-top:hover {
    transform: translateY(-2px) !important;
}

/* FAQ Accordion */
.collapse-content {
    transition: all 0.3s ease;
}

/* Mobile Footer Ad Fix */
@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }
}

@media (max-width: 767px) {
    body {
        padding-bottom: 60px;
    }
}

/* Print Styles */
@media print {
    .ad-container,
    .navbar,
    .footer,
    .btn {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid hsl(var(--p));
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: hsl(var(--p));
    color: hsl(var(--pc));
}
