/* ==========================================================================
   Elbatal TV — custom dialogs (alert / confirm / prompt)
   بيستخدم نفس هوية الهيدر والقائمة الجانبية: خلفية داكنة + أحمر البطل.
   ========================================================================== */

:root {
    --dlg-overlay: rgba(5, 5, 7, 0.7);
    --dlg-surface: #17171c;
    --dlg-surface-2: #1f1f26;
    --dlg-border: rgba(255, 255, 255, 0.09);
    --dlg-text: #f4f4f5;
    --dlg-muted: #9a9aa4;
    --dlg-accent: #ff3b30;
    --dlg-accent-dark: #c22017;
    --dlg-radius: 20px;
}

/* حاوية ثابتة للـ dialogs في الصفحة الرئيسية — بتخلي الـ confirm/prompt/alert
   فوق كل العناصر مهما كان ترتيب الـ DOM، حتى لو اتفتحوا من صفحة جوه iframe. */
#mou_dialog_host {
    position: relative;
    z-index: 2147483647;
}

.mou_dialog_overlay {
    position: fixed;
    inset: 0;
    /* أعلى من أي بوب أب أو قائمة في المشروع (.mou_popup عندها 2147483646)
       عشان تأكيد تسجيل الخروج مثلاً يظهر فوق بوب أب «أجهزتي». */
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: var(--dlg-overlay);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease, visibility 160ms ease;
}

.mou_dialog_overlay.show {
    opacity: 1;
    visibility: visible;
}

.mou_dialog {
    position: relative;
    width: min(430px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--dlg-border);
    border-radius: var(--dlg-radius);
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(255, 59, 48, 0.13), transparent 62%),
        linear-gradient(180deg, #1a1a20, #121216);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
    color: var(--dlg-text);
    transform: translateY(10px) scale(0.98);
    transition: transform 180ms ease;
}

.mou_dialog_overlay.show .mou_dialog {
    transform: none;
}

.mou_dialog_top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.mou_dialog_icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.2), rgba(255, 59, 48, 0.04));
    color: #ff6a5e;
    font-size: 1.05rem;
}

.mou_dialog.is-success .mou_dialog_icon {
    border-color: rgba(34, 197, 94, 0.32);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.04));
    color: #4ade80;
}

.mou_dialog.is-warning .mou_dialog_icon {
    border-color: rgba(245, 158, 11, 0.32);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.04));
    color: #fbbf24;
}

.mou_dialog.is-danger .mou_dialog_icon {
    border-color: rgba(239, 68, 68, 0.36);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.05));
    color: #f87171;
}

.mou_dialog_text {
    flex: 1 1 auto;
    min-width: 0;
}

.mou_dialog_title {
    margin: 2px 0 6px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
}

.mou_dialog_message {
    margin: 0;
    color: var(--dlg-muted);
    font-size: 0.88rem;
    line-height: 1.8;
    word-break: break-word;
}

.mou_dialog_close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--dlg-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.mou_dialog_close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mou_dialog_input_wrap {
    margin-top: 16px;
}

.mou_dialog_input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--dlg-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.mou_dialog_input:focus {
    border-color: rgba(255, 59, 48, 0.5);
    background: rgba(255, 59, 48, 0.06);
}

.mou_dialog_actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
}

.mou_dialog_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.mou_dialog_btn:active {
    transform: translateY(1px);
}

.mou_dialog_ok {
    background: linear-gradient(135deg, var(--dlg-accent), var(--dlg-accent-dark));
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 59, 48, 0.28);
}

.mou_dialog_ok:hover {
    background: linear-gradient(135deg, #ff5b50, var(--dlg-accent));
}

.mou_dialog.is-success .mou_dialog_ok {
    background: linear-gradient(135deg, #22c55e, #15803d);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.25);
}

.mou_dialog.is-success .mou_dialog_ok:hover {
    background: linear-gradient(135deg, #34d399, #16a34a);
}

.mou_dialog.is-danger .mou_dialog_ok {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

.mou_dialog.is-danger .mou_dialog_ok:hover {
    background: linear-gradient(135deg, #f87171, #dc2626);
}

.mou_dialog_cancel {
    border-color: var(--dlg-border);
    background: rgba(255, 255, 255, 0.04);
    color: #c9c9d1;
}

.mou_dialog_cancel:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.mou_dialog_cancel[hidden] {
    display: none;
}

.mou_dialog_message a {
    color: #ff8a80;
    text-decoration: underline;
}

@media only screen and (max-width: 480px) {
    .mou_dialog {
        padding: 18px;
        border-radius: 18px;
    }

    .mou_dialog_actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .mou_dialog_btn {
        width: 100%;
    }
}

/* الريموت / D-pad: إطار تركيز واضح زي باقي عناصر الموقع */
.mou_dialog_btn:focus-visible,
.mou_dialog_close:focus-visible,
.mou_dialog_input:focus-visible {
    outline: 2px solid #ff3b30;
    outline-offset: 2px;
}

/* ============================================================
   بوابة الإعلان/الاشتراك (Elbatal Gate) — أندرويد
   ============================================================ */
#elbatal_gate_popup .mou_popup_container {
    max-width: 520px;
}

#elbatal_gate_popup .mou_popup_body {
    padding: 14px 18px;
}

.elbatal_gate_features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.elbatal_gate_feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: #e8e8e8;
}

.elbatal_gate_feature i {
    color: #2ecc71;
    font-size: 14px;
    flex: 0 0 auto;
}

.elbatal_gate_offer {
    position: relative;
    border: 1px solid rgba(255, 59, 48, .45);
    background: linear-gradient(135deg, rgba(255, 59, 48, .14), rgba(157, 32, 25, .10));
    border-radius: 14px;
    padding: 10px 12px;
    margin: 8px 0 4px;
}

.elbatal_gate_badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff3b30, #b3261c);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 6px;
}

.elbatal_gate_offer_text {
    font-size: 13px;
    line-height: 1.65;
    color: #f2f2f2;
}

.elbatal_gate_offer_text b {
    color: #ffd166;
}

.elbatal_gate_packs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.elbatal_gate_pack {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    padding: 6px 9px;
    font-size: 12.5px;
    line-height: 1.3;
}

.elbatal_gate_pack b {
    font-weight: 600;
    color: #e8e8e8;
    white-space: nowrap;
}

.elbatal_gate_pack .elbatal_gate_pack_price {
    display: inline;
    color: #ffd166;
    font-weight: 700;
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
}

.elbatal_gate_footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 18px 14px;
    background: #17171c;
}

.elbatal_gate_footer .mou_btn {
    width: auto;
    margin-bottom: 0;
    padding: 10px 12px;
    font-size: 13px;
}

.mou_gate_primary {
    width: 100%;
    background: linear-gradient(135deg, #ff3b30, #b3261c) !important;
    border-color: transparent !important;
    font-size: 14px !important;
}

.elbatal_gate_secondary {
    display: flex;
    gap: 6px;
}

.elbatal_gate_secondary .mou_btn {
    flex: 1 1 0;
    white-space: nowrap;
}

/* أزرار ثانوية أهدى من زر الاشتراك الأحمر */
.mou_popup_footer .elbatal_gate_secondary .mou_btn,
.mou_popup_footer .elbatal_gate_secondary .mou_btn:hover,
.mou_popup_footer .elbatal_gate_secondary .mou_btn:active {
    background: rgba(255, 255, 255, .07);
    background-image: none;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: none;
    color: #ededf0;
    font-weight: 600;
}

.mou_popup_footer .elbatal_gate_secondary .mou_btn:hover {
    background: rgba(255, 255, 255, .13);
}

.elbatal_gate_secondary .mou_btn:focus-visible,
.mou_gate_primary:focus-visible {
    outline: 2px solid #ff3b30;
    outline-offset: 2px;
}
