/* App-specific styles — shared styles in detail-shared.css */

/* ===== Skeleton (app-specific ID) ===== */
#app-detail-skeleton {
    position: relative;
}

#app-detail-skeleton .pd-hero {
    animation: none;
}

/* Staggered reveal (app-specific ID) */
#app-detail-content.pd-revealing {
    opacity: 1 !important;
}


/* ===== Hero (app-specific: position relative) ===== */
.pd-hero {
    position: relative;
}

/* Apps Hero Trust & Stats Badges */
.apps-hero-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px auto 0;
}

.apps-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.apps-hero-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.35);
}

.apps-hero-pill i,
.apps-hero-pill svg {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.apps-hero-pill strong {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-weight: 700;
}

body.light-theme .apps-hero-pill {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(24, 24, 27, 0.09);
    box-shadow: 0 4px 12px -4px rgba(24, 24, 27, 0.05), inset 0 1px 0 #ffffff;
    color: #52525b;
}

body.light-theme .apps-hero-pill strong {
    color: #18181b;
}

@media (max-width: 600px) {
    .apps-hero-badges {
        gap: 8px;
    }
    .apps-hero-pill {
        padding: 6px 12px;
        font-size: 0.76rem;
    }
}

/* ===== Badges (apps version — absolute positioned) ===== */
.pd-badges {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.pd-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Category (app-specific extras) ===== */
.pd-category {
    align-items: center;
    gap: 6px;
}

/* ===== Key Gate ===== */
.key-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70dvh;
    padding: 120px 20px 40px;
}

.key-gate-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: 26px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 20px 50px -12px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: keyGateIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes keyGateIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.key-gate-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.key-gate-icon i,
.key-gate-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
    stroke: var(--accent-primary);
}

.key-gate-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.key-gate-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.55;
}

.key-gate-input-wrap {
    margin-bottom: 16px;
}

.key-gate-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-align: center;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    box-sizing: border-box;
}

.key-gate-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.key-gate-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
    background: rgba(255, 255, 255, 0.05);
}

.key-gate-input.error {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    animation: keyShake 0.4s ease-in-out;
}

@keyframes keyShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.key-gate-error {
    margin-top: 10px;
    font-size: 0.82rem;
    color: #ef4444;
    font-weight: 500;
    transition: opacity 0.3s;
}

.key-gate-error.hidden {
    display: none;
}

.key-gate-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.96rem;
    font-weight: 700;
    border-radius: 9999px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.key-gate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

.key-gate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.key-gate-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.key-gate-footer p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.key-gate-contacts {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.key-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    transition: transform 0.2s, opacity 0.2s, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.key-contact-link i,
.key-contact-link svg {
    width: 16px;
    height: 16px;
}

.key-contact-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* ===== Remaining Days Banner ===== */
.key-remaining-container {
    min-height: 44px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: min-height 0.3s ease, margin 0.3s ease;
}

.key-remaining-container.collapsed {
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.key-remaining {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.22);
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    animation: keyGateIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.key-remaining.expired {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.key-remaining i,
.key-remaining svg {
    width: 16px;
    height: 16px;
}

.key-remaining.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .key-gate-card {
        padding: 32px 24px;
        border-radius: 22px;
    }

    .key-gate-title {
        font-size: 1.25rem;
    }

    .key-gate-input {
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    .key-gate-contacts {
        flex-direction: column;
        gap: 8px;
    }
}

/* Light theme — key gate */
body.light-theme .key-gate-card {
    background: #ffffff;
    border-color: rgba(24, 24, 27, 0.08);
    box-shadow: 0 12px 36px rgba(24, 24, 27, 0.08);
}
body.light-theme .key-gate-title { color: #18181b; }
body.light-theme .key-gate-desc { color: #52525b; }
body.light-theme .key-gate-input {
    background: #faf9f5;
    border-color: rgba(24, 24, 27, 0.12);
    color: #18181b;
}
body.light-theme .key-gate-input::placeholder { color: #71717a; }
body.light-theme .key-gate-footer { border-top-color: rgba(24, 24, 27, 0.06); }
body.light-theme .key-gate-footer p { color: #71717a; }
body.light-theme .key-contact-link {
    background: rgba(24, 24, 27, 0.03);
    border-color: rgba(24, 24, 27, 0.08);
    color: #52525b;
}
body.light-theme .key-remaining {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
}

/* ===== Full-Screen Download Countdown View ===== */
.dl-container {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 2rem;
}

.dl-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.dl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 26px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.45);
    animation: dl-card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dl-card-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dl-app-icon {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: var(--accent-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dl-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dl-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.dl-countdown-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.dl-countdown-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dl-countdown-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 6;
}

.dl-countdown-progress {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.dl-countdown-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.dl-timer-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.dl-timer-label span {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--accent-primary);
    font-weight: 600;
}

.dl-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    border-radius: 9999px;
    background: #fafafa;
    color: #09090b;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid #ffffff;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px -6px rgba(255, 255, 255, 0.2);
    animation: dl-btn-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.light-theme .dl-download-btn {
    background: #18181b;
    color: #fafafa;
    border-color: #18181b;
    box-shadow: 0 8px 24px -6px rgba(24, 24, 27, 0.25);
}

@keyframes dl-btn-appear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dl-download-btn:hover {
    transform: translateY(-2px);
}

.dl-back-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.dl-back-link:hover {
    color: var(--text-primary);
}

.dl-countdown-wrap.completed .dl-countdown-progress {
    stroke: #10b981;
}

.dl-countdown-wrap.completed .dl-countdown-text {
    color: #10b981;
    font-size: 1.8rem;
}

.dl-meta-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.8rem;
}

.dl-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.dl-badge-item .dl-badge-icon {
    width: 14px;
    height: 14px;
}

.dl-badge-safe {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.dl-badge-scan {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.dl-badge-info {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.dl-guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    padding: 1.8rem 1.6rem;
    max-width: 480px;
    width: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.25);
}

.dl-guide-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
}

.dl-steps-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dl-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.dl-step-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-light);
    transform: translateX(3px);
}

.dl-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.dl-step-item.active-step .dl-step-number {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.dl-step-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.dl-step-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

@media (max-width: 480px) {
    .dl-card {
        padding: 2rem 1.5rem;
        border-radius: 22px;
    }

    .dl-title {
        font-size: 1.25rem;
    }

    .dl-guide-card {
        padding: 1.4rem 1.2rem;
    }
}

/* Light theme — download view */
body.light-theme .dl-card {
    background: #ffffff;
    border-color: rgba(24, 24, 27, 0.08);
    box-shadow: 0 12px 36px rgba(24, 24, 27, 0.06);
}
body.light-theme .dl-title { color: #18181b; }
body.light-theme .dl-subtitle { color: #52525b; }
body.light-theme .dl-countdown-text { color: #18181b; }
body.light-theme .dl-countdown-track { stroke: rgba(24, 24, 27, 0.08); }
body.light-theme .dl-timer-label { color: #52525b; }
body.light-theme .dl-back-link { color: #52525b; }
body.light-theme .dl-back-link:hover { color: #18181b; }
body.light-theme .dl-guide-card {
    background: #ffffff;
    border-color: rgba(24, 24, 27, 0.08);
    box-shadow: 0 8px 32px rgba(24, 24, 27, 0.05);
}
body.light-theme .dl-guide-title { color: #18181b; }
body.light-theme .dl-step-item {
    background: #faf9f5;
    border-color: rgba(24, 24, 27, 0.06);
}
body.light-theme .dl-step-item:hover {
    background: #f3f1eb;
    border-color: rgba(24, 24, 27, 0.14);
}
body.light-theme .dl-step-content h4 { color: #18181b; }
body.light-theme .dl-step-content p { color: #52525b; }
body.light-theme .dl-badge-safe {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.22);
}
body.light-theme .dl-badge-scan {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.2);
}
body.light-theme .dl-badge-info {
    background: rgba(24, 24, 27, 0.05);
    color: #52525b;
    border-color: rgba(24, 24, 27, 0.1);
}
