/* ============================================================================
   طيف (tayf) — رأس قُمرة القيادة
   ============================================================================
   منقول عن تصميم tayf.ae (dashboard/index.html + css/dashboard.css): شريط رمز
   المؤسسة + البنر الدعائي + بنر الاشتراك مع العدّاد التنازلي.

   ملف مستقل عن قوالب اللوحة الجاهزة، ويستخدم متغيّراته الخاصة (المسبوقة بـ
   tayf-) حتى لا يتعارض مع --app-primary-color التي يحقنها قالب الأدمن من
   إعدادات المتجر.
   ============================================================================ */

.tayf-dash {
    --tayf-gold: #f8cb25;
    --tayf-ink: #0e0e14;
    --tayf-blue: #3164f5;
    --tayf-white: #ffffff;
    --tayf-gray-900: #333333;
    --tayf-gray-700: #55565c;
    --tayf-gray-500: #afafaf;
    --tayf-gray-300: #e0e0e0;
    --tayf-gray-100: #f4f4f4;
    --tayf-radius-sm: 8px;
    --tayf-radius-md: 14px;
    --tayf-radius-lg: 24px;
    --tayf-radius-full: 999px;

    margin-bottom: 1.5rem;
}

.tayf-dash *,
.tayf-dash *::before,
.tayf-dash *::after {
    box-sizing: border-box;
}

.tayf-dash .tayf-icon {
    width: 18px;
    height: 18px;
    flex: none;
}

/* -------------------------------- شريط رمز المؤسسة -------------------------------- */
.tayf-code-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.tayf-code-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tayf-gray-100);
    border: 1px solid var(--tayf-gray-300);
    border-radius: var(--tayf-radius-md);
    padding: 6px 14px 6px 6px;
}

.tayf-code-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tayf-gray-700);
    white-space: nowrap;
}

.tayf-code-value {
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--tayf-gray-900);
    width: 9ch;
    padding: 0;
    cursor: default;
}

.tayf-code-value:focus {
    outline: none;
}

.tayf-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: none;
    border: none;
    border-radius: var(--tayf-radius-sm);
    background: var(--tayf-white);
    color: var(--tayf-blue);
    cursor: pointer;
    transition: background 0.15s ease;
}

.tayf-copy-btn:hover {
    background: rgba(49, 100, 245, 0.1);
}

.tayf-copy-btn .tayf-icon {
    width: 16px;
    height: 16px;
}

/* ---------- زرّا تطبيقي نقطة البيع بجانب رمز المتجر ---------- */
.tayf-code-row {
    gap: 8px;
    flex-wrap: wrap;
}

.tayf-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--tayf-gray-300);
    border-radius: var(--tayf-radius-md);
    background: var(--tayf-white);
    color: var(--tayf-gray-900);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.tayf-app-btn:hover {
    border-color: var(--tayf-blue);
    color: var(--tayf-blue);
    text-decoration: none;
}

.tayf-app-btn .tayf-icon {
    width: 18px;
    height: 18px;
}

#tayfAndroidApp .tayf-icon { color: #3ddc84; }
#tayfWindowsApp .tayf-icon { color: #0078d4; }

/* نافذة شرح تطبيق أندرويد (SweetAlert) — تُرسم خارج .tayf-dash فلا ترى متغيّراته: ألوان صريحة */
.tayf-app-help { text-align: start; font-size: 0.92rem; line-height: 1.9; }
.tayf-app-help ol { padding-inline-start: 1.3rem; margin: 0 0 1rem; }
.tayf-app-downloader {
    display: block;
    width: 200px;
    max-width: 60%;
    height: auto;
    margin: 0 auto 14px;
    border-radius: 12px;
}
.tayf-app-help .tayf-app-code {
    display: inline-block;
    direction: ltr;
    padding: 2px 10px;
    border-radius: 8px;
    background: #fff2e8;
    color: #f47920;
    font-size: 1.25rem;
    letter-spacing: 3px;
}

/* -------------------------------- البنر الدعائي --------------------------------
   ارتفاع البنر يتبع نسبة أبعاد الصورة (2000×500) فتظهر كاملة بلا قص. */
.tayf-promo-banner {
    border-radius: var(--tayf-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    line-height: 0;
}

.tayf-promo-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ------------------------------ سلايدر البنرات ------------------------------
   بنر واحد يبقى كما هو (لا يدخل هنا شيء). اثنان فأكثر يتناوبان بالتلاشي:
   الشرائح مكدّسة فوق بعضها، والفعّالة وحدها ظاهرة. والتلاشي لا الإزاحة،
   لأنّ الإزاحة تحتاج اتجاهًا واللوحة تنقلب بين العربية والإنجليزية.

   والارتفاع يتبع الشريحة الأولى (`position: relative`) فلا يقفز القسم
   عند الانتقال، ما دامت بنرات طيف بنسبة واحدة (2000×500). */
.tayf-promo-banner.is-slider {
    position: relative;
}

.tayf-promo-banner.is-slider .tayf-promo-track {
    position: relative;
}

.tayf-promo-banner.is-slider .tayf-promo-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

/* الأولى وحدها في التدفّق العاديّ: هي التي تعطي القسم ارتفاعه */
.tayf-promo-banner.is-slider .tayf-promo-slide:first-child {
    position: relative;
}

.tayf-promo-banner.is-slider .tayf-promo-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* النقاط: على الصورة لا تحتها، فلا تزيد ارتفاع القسم */
.tayf-promo-dots {
    position: absolute;
    inset-inline: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
    line-height: 0;
}

.tayf-promo-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.25s ease, width 0.25s ease;
}

.tayf-promo-dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

.tayf-promo-dot.is-active {
    width: 22px;
    border-radius: 5px;
    background: #fff;
}

@media (max-width: 575.98px) {
    .tayf-promo-dots {
        bottom: 8px;
        gap: 6px;
    }

    .tayf-promo-dot {
        width: 7px;
        height: 7px;
    }

    .tayf-promo-dot.is-active {
        width: 16px;
    }
}

/* من يطلب تقليل الحركة: لا تلاشي ولا تناوب تلقائيّ (يوقفه السكربت أيضًا) */
@media (prefers-reduced-motion: reduce) {
    .tayf-promo-banner.is-slider .tayf-promo-slide {
        transition: none;
    }
}

/* -------------------------------- بنر الاشتراك -------------------------------- */
.tayf-subscription-banner {
    background: var(--tayf-ink);
    color: var(--tayf-white);
    border-radius: var(--tayf-radius-lg);
    padding: 24px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.tayf-subscription-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.tayf-subscription-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.05rem;
    margin: 0 0 4px;
    color: var(--tayf-white);
}

.tayf-subscription-title .tayf-icon {
    color: var(--tayf-gold);
}

.tayf-subscription-date {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin: 0;
}

.tayf-subscription-plan-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tayf-subscription-plan-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--tayf-gold);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: var(--tayf-radius-full);
    white-space: nowrap;
}

.tayf-subscription-plan-badge .tayf-icon {
    width: 14px;
    height: 14px;
}

.tayf-upgrade-btn {
    background: var(--tayf-gold);
    color: var(--tayf-ink);
    border: none;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: var(--tayf-radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.18s ease;
}

.tayf-upgrade-btn:hover {
    transform: translateY(-1px);
    color: var(--tayf-ink);
}

.tayf-upgrade-btn .tayf-icon {
    width: 15px;
    height: 15px;
}

.tayf-renew-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tayf-white);
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 11px 18px;
    border-radius: var(--tayf-radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.18s ease;
}

.tayf-renew-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--tayf-white);
}

.tayf-renew-btn .tayf-icon {
    width: 15px;
    height: 15px;
}

/* -------------------------------- العدّاد التنازلي -------------------------------- */
.tayf-countdown {
    display: flex;
    gap: 10px;
}

.tayf-countdown-cell {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--tayf-radius-sm);
    min-width: 64px;
    padding: 10px 6px;
    text-align: center;
}

.tayf-countdown-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    /* أرقام متساوية العرض حتى لا يهتزّ العدّاد كل ثانية */
    font-variant-numeric: tabular-nums;
}

.tayf-countdown-label {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

@media (max-width: 767px) {
    .tayf-subscription-banner {
        padding: 16px;
    }

    .tayf-countdown-cell {
        min-width: 54px;
        padding: 8px 4px;
    }

    .tayf-countdown-num {
        font-size: 1.2rem;
    }

    .tayf-code-row {
        justify-content: flex-start;
    }
}

/* ---------------------------------------------------------------------------
   الزرّان صارا روابط إلى شاشة الباقات
   --------------------------------------------------------------------------- */
.tayf-upgrade-btn,
.tayf-renew-btn {
    text-decoration: none;
}

.tayf-upgrade-btn:hover,
.tayf-renew-btn:hover {
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   شارة الحالة — تُقرأ لونًا قبل أن تُقرأ نصًّا
   --------------------------------------------------------------------------- */
.tayf-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--tayf-radius-full);
    line-height: 1;
}

.tayf-status-chip::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tayf-status-active,
.tayf-status-trial {
    background: rgba(45, 190, 120, 0.16);
    color: #4ade80;
}

.tayf-status-maintenance {
    background: rgba(255, 193, 7, 0.16);
    color: #ffc107;
}

.tayf-status-cancelled,
.tayf-status-suspended {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
