/* SkyDownloader v4.0 - Main Stylesheet */

body {
    background-color: #030712;
    background-image: 
        radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.007) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

.glow-effect:hover {
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
}

.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.15;
    transition: opacity 0.3s ease;
}

.glow-border:focus-within::after {
    opacity: 0.7;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

#result-state:not(.hidden) {
    animation: fadeIn 0.35s ease;
}

#download-links-container a {
    animation: fadeIn 0.3s ease;
}

/* Sponsor banner iOS-style animation */
#iosAd {
    display: none;
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    transform: translate(-50%, -40px) scale(.9);
    opacity: 0;
    filter: blur(4px);
    max-width: 380px;
    width: 92%;
    z-index: 9999;
    transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .35s ease-out, filter .35s ease-out;
    will-change: transform, opacity;
}

#iosAd.is-visible {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    filter: blur(0);
}

#iosAd.is-hiding {
    transition: transform .32s cubic-bezier(.4, 0, 1, 1), opacity .28s ease-in, filter .28s ease-in;
    transform: translate(-50%, -24px) scale(.94);
    opacity: 0;
    filter: blur(2px);
}

#iosAd .ios-card {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 26px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .06);
    padding: 20px 22px;
    color: #111;
    transition: transform .15s ease;
}

#iosAd .ios-card:active {
    transform: scale(.97);
}

#iosAd .ios-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: none;
    background: rgba(120, 120, 128, .16);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .15s ease;
}

#iosAd .ios-close:hover {
    background: rgba(120, 120, 128, .28);
}

#iosAd .ios-close:active {
    transform: scale(.9);
}

/* Format/Quality Selector Tabs */
.format-tabs {
    display: none;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.format-tabs.is-visible {
    display: flex;
}

.format-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #a1a5b1;
    font-size: 0.875rem;
    font-family: Fira Code, monospace;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.format-tab:hover {
    color: #cbd5e1;
}

.format-tab.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
}

.format-content {
    display: none;
}

.format-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Support Modal — visibility is controlled purely by Tailwind's `hidden`
   class (toggled in JS); no separate display rule needed here, avoiding any
   specificity conflict between an ID selector and the utility class. */
.support-modal-inner {
    animation: fadeIn 0.3s ease;
}

.qris-container {
    text-align: center;
    padding: 1.5rem 0;
}

.qris-image {
    max-width: 280px;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin: 0 auto;
}

/* Support Floating Button */
#support-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
    transition: all 0.3s ease;
    z-index: 40;
}

#support-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(56, 189, 248, 0.6);
}

#support-btn:active {
    transform: scale(0.95);
}

/* Route-based visibility (3-way: home / admin / about). Backed up in JS
   too (defense in depth), matching the data-route attribute set on <html>
   both at cold-load (see inline <head> script) and on every in-page
   navigation (see skyNavigate in script.js). */
html[data-route="admin"] .public-only,
html[data-route="admin"] .home-only,
html[data-route="about"] .home-only {
    display: none !important;
}
html:not([data-route="admin"]) #admin-page { display: none !important; }
html:not([data-route="about"]) #about-page { display: none !important; }

/* Legacy selector kept as a harmless no-op alias for the old class name */
html.route-admin .public-only { display: none !important; }

/* About page ("Meet the Creator") */
#about-page {
    animation: fadeIn 0.4s ease;
}

#about-page h1 {
    letter-spacing: -0.01em;
}

