/* ==================== التبويبات السفلية (محسّنة) ==================== */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 200;
    box-shadow: 0 -1px 0 var(--border);
    transition: background-color .25s ease, border-color .25s ease;
}

/* شفافية في الوضع الفاتح (iOS-like) */
:root .bottom-tabs {
    background: rgba(255, 255, 255, .92);
    border-top-color: rgba(15, 23, 42, .06);
    box-shadow: 0 -1px 0 rgba(15, 23, 42, .04);
}

[data-theme="dark"] .bottom-tabs {
    background: rgba(26, 31, 38, .92);
    border-top-color: rgba(255, 255, 255, .08);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .3);
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .68rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s ease;
    font-family: inherit;
}

    .tab:active {
        background: rgba(79, 70, 229, .08);
    }

[data-theme="dark"] .tab:active {
    background: rgba(99, 102, 241, .12);
}

.tab.active {
    color: var(--primary);
    font-weight: 800;
}

    .tab.active::before {
        content: '';
        position: absolute;
        top: 6px;
        width: 22px;
        height: 3px;
        background: var(--primary);
        border-radius: 2px;
        animation: tabIndicator .25s cubic-bezier(.34, 1.3, .64, 1);
    }

@keyframes tabIndicator {
    from {
        opacity: 0;
        transform: scaleX(.4);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.tab-icon {
    font-size: 1.4rem;
    position: relative;
    line-height: 1;
    transition: transform .2s ease;
    display: inline-block;
}

.tab.active .tab-icon {
    transform: scale(1.08);
}

.tab-label {
    line-height: 1;
    letter-spacing: -.2px;
    transition: opacity .2s ease;
}

.tab-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, .4);
    border: 2px solid var(--surface);
    animation: badgePulse .3s ease;
}

[data-theme="dark"] .tab-badge {
    border-color: #1a1f26;
}

@keyframes badgePulse {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}


/* ================================================================
           بانر التثبيت
           ================================================================ */
.install-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--primary), #0c9);
    color: #fff;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .install-banner:active {
        transform: scale(.98);
        box-shadow: 0 3px 10px rgba(79, 70, 229, .3);
    }

.install-banner-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, .2);
    border-radius: 12px;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner-title {
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 2px;
}

.install-banner-sub {
    font-size: 12px;
    opacity: .85;
    line-height: 1.3;
}

.install-banner-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease;
}

    .install-banner-btn:active {
        transform: scale(.94);
    }

/* نسخة iOS — لون مختلف */
.install-banner-ios {
    background: linear-gradient(135deg, #1c1c1e, #3a3a3c);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

    .install-banner-ios .install-banner-btn {
        color: #1c1c1e;
    }

/* ================================================================
           مودال إرشادات iOS
           ================================================================ */
.install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 200;
}

[data-theme="dark"] .install-overlay {
    background: rgba(0, 0, 0, .72);
}

.install-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.install-modal {
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    background: var(--surface);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(.98);
    transition: transform .25s ease, background-color .25s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

[data-theme="dark"] .install-modal {
    box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}

.install-overlay.active .install-modal {
    transform: translateY(0) scale(1);
}

.install-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

    .install-modal-head h5 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: var(--text);
    }

    .install-modal-head .scanner-close {
        width: 34px;
        height: 34px;
        border: none;
        border-radius: 50%;
        font-size: 16px;
        cursor: pointer;
        background: var(--surface-2);
        color: var(--text);
    }

/* الخطوات */
.install-steps {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.install-step-num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

.install-step strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text);
}

.install-step p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(79, 70, 229, .12);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
    margin: 0 3px;
    vertical-align: middle;
}

[data-theme="dark"] .share-icon {
    background: rgba(99, 102, 241, .2);
}

/* زر الفهم */
.install-modal .btn-save {
    margin: 8px 16px 16px;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease;
}

    .install-modal .btn-save:active {
        transform: scale(.97);
    }
