/* ==========================================================================
   Bookworm School Portals — PWA Download / Install Styles
   ========================================================================== */

.pwa-install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 16px;
    margin: 12px 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(29, 158, 117, 0.25) 0%, rgba(29, 158, 117, 0) 70%);
    pointer-events: none;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.pwa-install-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d9e75, #0f766e);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(29, 158, 117, 0.4);
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pwa-install-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-install-desc {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.3;
    margin-top: 2px;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-btn-install {
    background: #1d9e75;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(29, 158, 117, 0.35);
}

.pwa-btn-install:hover, .pwa-btn-install:active {
    background: #178a65;
    transform: translateY(-1px);
}

.pwa-btn-dismiss {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 18px;
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-btn-dismiss:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
}

/* Floating Install Trigger Pill */
.pwa-floating-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(29, 158, 117, 0.12);
    color: #1d9e75;
    border: 1px solid rgba(29, 158, 117, 0.25);
    border-radius: 9999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-floating-btn:hover {
    background: #1d9e75;
    color: #ffffff;
}

/* iOS Safari Install Guide Bottom Sheet */
.pwa-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.pwa-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.pwa-modal-sheet {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-modal-backdrop.is-open .pwa-modal-sheet {
    transform: translateY(0);
}

.pwa-sheet-handle {
    width: 38px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.pwa-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pwa-sheet-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-sheet-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.pwa-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.pwa-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1d9e75;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-step-text {
    font-size: 13.5px;
    color: #334155;
    line-height: 1.4;
}

.pwa-step-text strong {
    color: #0f172a;
}

.pwa-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 14px;
    color: #0284c7;
    margin: 0 2px;
    vertical-align: middle;
}

.pwa-btn-got-it {
    width: 100%;
    background: #1d9e75;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-btn-got-it:hover {
    background: #178a65;
}

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