/* ============================================
   SpicyLinks — PWA Install Bottom Sheet
   ============================================ */

/* ── Overlay ── */
.pwa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.pwa-overlay.pwa-visible {
    opacity: 1;
}

/* ── Sheet ── */
.pwa-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--surface, #111116);
    border-radius: 20px 20px 0 0;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 24px 28px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pwa-sheet.pwa-visible {
    transform: translateY(0);
}

/* ── Handle ── */
.pwa-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 2px;
    margin: 12px auto 20px;
    flex-shrink: 0;
}

/* ── Header ── */
.pwa-sheet-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.pwa-sheet-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.pwa-sheet-icon-fallback {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7A2041 0%, #B5305A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(122, 32, 65, 0.3);
}

.pwa-sheet-header-text {
    flex: 1;
    min-width: 0;
}

.pwa-sheet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text, #F5F5F7);
    margin: 0 0 2px;
    line-height: 1.3;
}

.pwa-sheet-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    margin: 0;
}

/* ── Body ── */
.pwa-sheet-body {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    margin-bottom: 20px;
}

/* ── iOS Steps ── */
.pwa-ios-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwa-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-ios-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7A2041 0%, #B5305A 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-ios-step-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    line-height: 1.5;
    padding-top: 3px;
}

.pwa-ios-step-text strong {
    color: var(--text, #F5F5F7);
}

.pwa-ios-step-icon {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 2px;
}

/* ── Buttons ── */
.pwa-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pwa-btn-install {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #7A2041 0%, #B5305A 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pwa-btn-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(122, 32, 65, 0.35);
}

.pwa-btn-install:active {
    transform: translateY(0);
}

.pwa-btn-later {
    width: 100%;
    padding: 11px 20px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-btn-later:hover {
    background: var(--surface-hover, rgba(255, 255, 255, 0.06));
    border-color: var(--border-hover, rgba(255, 255, 255, 0.15));
}

.pwa-btn-never {
    width: 100%;
    padding: 8px;
    border: none;
    background: none;
    color: var(--text-faint, rgba(255, 255, 255, 0.3));
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
}

.pwa-btn-never:hover {
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

/* ── Close X ── */
.pwa-sheet-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--surface-hover, rgba(255, 255, 255, 0.06));
    border-radius: 50%;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.pwa-sheet-close:hover {
    background: var(--surface-active, rgba(255, 255, 255, 0.1));
    color: var(--text, #F5F5F7);
}

/* ── Light Theme ── */
[data-theme="light"] .pwa-sheet {
    background: #fff;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .pwa-sheet-handle {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .pwa-sheet-title {
    color: #111116;
}

[data-theme="light"] .pwa-sheet-subtitle {
    color: #6E6E7A;
}

[data-theme="light"] .pwa-sheet-body {
    color: #4A4A5A;
}

[data-theme="light"] .pwa-ios-step-text {
    color: #4A4A5A;
}

[data-theme="light"] .pwa-ios-step-text strong {
    color: #111116;
}

[data-theme="light"] .pwa-btn-later {
    border-color: rgba(0, 0, 0, 0.12);
    color: #4A4A5A;
}

[data-theme="light"] .pwa-btn-later:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .pwa-btn-never {
    color: #9A9AA6;
}

[data-theme="light"] .pwa-sheet-close {
    background: rgba(0, 0, 0, 0.05);
    color: #6E6E7A;
}

[data-theme="light"] .pwa-sheet-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111116;
}

/* ── Animations ── */
@keyframes pwa-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes pwa-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Safe area for notch devices ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pwa-sheet {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }
}
