/* ============================================================
   APK Download — centered overlay + scaled parachute animation
   Pair with: apk-download.js (depends on GSAP 3.x)
   Animation markup is adapted from pwa-install-btn (parachute).
   ============================================================ */

/* Navbar trigger button (icon + label) */
.apk-dl-trigger {
    -webkit-tap-highlight-color: transparent;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.apk-dl-trigger:hover {
    filter: brightness(1.07);
    box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.55);
    transform: translateY(-1px);
}
.apk-dl-trigger:active { transform: translateY(0); }
.apk-dl-trigger svg { width: 16px; height: 16px; }

/* Fullscreen overlay */
.apk-dl-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(7, 12, 24, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.apk-dl-overlay.show {
    display: flex;
    opacity: 1;
}

.apk-dl-card {
    position: relative;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 106px 70px 56px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.22, 1.36, 0.62, 1);
    min-width: 520px;
    max-width: 92vw;
    box-sizing: border-box;
}
.apk-dl-overlay.show .apk-dl-card { transform: scale(1); }

.apk-dl-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.apk-dl-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}
.apk-dl-close svg { width: 14px; height: 14px; }

.apk-dl-title {
    margin-top: 22px;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.apk-dl-sub {
    margin-top: 6px;
    color: rgba(226, 232, 240, 0.6);
    font-size: 12px;
}

/* ---- Parachute animation (scaled, always-active) -------------- */
.apk-dl-stage {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}
.apk-dl-stage .dl-parachute {
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    outline: none;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    transform: translate(-50%, -50%) scale(4.5);
    transform-origin: center center;
    display: inline-flex;
    align-items: center;
    overflow: visible;
    z-index: 10;
}
.apk-dl-stage .dl-parachute svg { display: block; pointer-events: none; }

.apk-dl-stage .dl-parachute svg.circle,
.apk-dl-stage .dl-parachute svg.line {
    width: 80px;
    height: 36px;
    position: absolute;
    left: -22px;
    stroke-width: 3px;
    stroke-linecap: round;
    stroke: #38bdf8;
    fill: none;
}
.apk-dl-stage .dl-parachute svg.circle {
    top: 0;
    transform: rotate(180deg);
}
.apk-dl-stage .dl-parachute svg.line {
    height: 36px;
    bottom: -18px;
    opacity: 0;
}
.apk-dl-stage .dl-parachute svg.line .progress {
    stroke-width: 6px;
    stroke-dasharray: 260px;
    stroke-dashoffset: 260px;
    opacity: 0;
    stroke: #34d399;
}

.apk-dl-stage .dl-parachute .arrow {
    position: absolute;
    left: 10px;
    top: 10px;
}
.apk-dl-stage .dl-parachute .arrow .base {
    fill: #fff;
    width: 16px;
    height: 16px;
    overflow: visible;
}
/* Parachute is ABOVE the arrow (realistic physics — arrow hangs from chute) */
.apk-dl-stage .dl-parachute .arrow .parachute {
    position: absolute;
    width: 22px;
    height: 15px;
    fill: #fff;
    left: -3px;        /* horizontally centered on the arrow shaft (arrow base is 16px) */
    top: -15px;        /* sits directly on top of the arrow */
    bottom: auto;
    transform-origin: 50% 100%;
    transform: scale(0);
    opacity: 1;
    overflow: visible;
}
/* In-SVG percentage is hidden — we render the live counter inside the card title instead */
.apk-dl-stage .dl-parachute .number { display: none; }
.apk-dl-stage .dl-parachute .success {
    position: absolute;
    left: 0;
    right: 0;
    top: 2px;
    text-align: center;
    color: #fff;
    opacity: 0;
    font-size: 7px;
    white-space: nowrap;
}
