/* ============================================================
 * Aljazair Press 3.3.1 — إعدادات أيقونات الفيديو (Video Icons Settings)
 * ------------------------------------------------------------
 * 1) طبقة الربط في الواجهة: تثبيت حاويات المصغرات ليتمركز الشعار
 *    بدقة داخل الصورة في كل مواضع القالب، وسلوك التمرير الموحد
 *    (نفس سلوك أيقونات أقسام الفيديو) على كل الحاويات.
 * 2) أنماط قسم اللوحة: شبكة مكتبة الأيقونات، صف الألوان، المعاينة الحية.
 * لا يحتوي أي شكل رسم — الأشكال الـ27 في video-sections.css (مصدر واحد).
 * ============================================================ */

/* ---------- 1) حاويات المصغرات: التمركز ---------- */
.ajp-vi { z-index: 4; }

.post-card-thumb-frame,
.hpb-compact-thumb,
.hpb-mostread-thumb,
.hpb-hero-split-img,
.hpb-rich-thumb,
.hpb-tl-thumb,
.hpb-stack-thumb,
.hpb-alt-thumb,
.hpb-photo-img-link,
.newsroom-side-thumb,
.newsroom-main-card > a,
.style-card-box > a,
.mag-card > a,
.hpb-hero-card > a,
.hpb-stack-feat > a,
.apd-rel-thumb,
.dz-article-featured,
.dz-single-featured,
.dz-related-card {
    position: relative;
    display: block;
}

/* الحاويات التي كانت block أصلاً (أو flex) لا نفكك عرضها */
.newsroom-side-thumb,
.hpb-rich-thumb,
.hpb-tl-thumb,
.hpb-stack-thumb,
.hpb-alt-thumb,
.hpb-compact-thumb {
    display: inline-block;
    max-width: 100%;
}

/* المقال الفردي: الغلاف صورة كاملة العرض (بنفس فراغ الإصدار السابق) */
.dz-article-featured,
.dz-single-featured { width: 100%; margin-bottom: 20px; }
.dz-article-featured img,
.dz-single-featured img { width: 100%; height: auto; display: block; }

/* ---------- 1-b) مواضع استعادة دقيقة ---------- */
/* بطاقة الفيديو الكبيرة في عرض «الفيديو»: كانت أيقونتها الأصلية عند 38% من الأعلى */
.video-featured-card > a > .ajp-vi.vs-icp-center { top: 38%; }
/* ملاحظة: المثلثات البديلة (ajp-play-tri و ajp-live-tri) في style.css الرئيسي
   لأنها يجب أن تعمل حتى عند تعطيل النظام العام */

/* ---------- 2) سلوك الأيقونة العامة: نفس تفاعلات أقسام الفيديو ---------- */
.ajp-vi {
    transition: background .25s ease, scale .25s ease, opacity .3s ease,
                translate .3s ease, box-shadow .25s ease, color .25s ease;
}

/* ظهور دائم / عند التمرير فقط */
.ajp-vi.vs-icv-hover { opacity: 0; scale: .85; }

/* تأثيرات Hover على الحاويات المعروفة (نفس قيم أقسام الفيديو) */
.hpb-compact-thumb:hover > .ajp-vi.vs-ica-zoom,
.hpb-overlay-img-link:hover > .ajp-vi.vs-ica-zoom,
.hpb-mostread-thumb:hover > .ajp-vi.vs-ica-zoom,
.hpb-hero-split-img:hover > .ajp-vi.vs-ica-zoom,
.hpb-mosaic-img-link:hover > .ajp-vi.vs-ica-zoom,
.hpb-rich-thumb:hover > .ajp-vi.vs-ica-zoom,
.hpb-tl-thumb:hover > .ajp-vi.vs-ica-zoom,
.hpb-stack-thumb:hover > .ajp-vi.vs-ica-zoom,
.hpb-alt-thumb:hover > .ajp-vi.vs-ica-zoom,
.hpb-photo-img-link:hover > .ajp-vi.vs-ica-zoom,
.newsroom-side-thumb:hover > .ajp-vi.vs-ica-zoom,
.newsroom-main-card > a:hover > .ajp-vi.vs-ica-zoom,
.style-card-box > a:hover > .ajp-vi.vs-ica-zoom,
.mag-card > a:hover > .ajp-vi.vs-ica-zoom,
.hpb-hero-card > a:hover > .ajp-vi.vs-ica-zoom,
.hpb-stack-feat > a:hover > .ajp-vi.vs-ica-zoom,
.post-card-thumb:hover > .ajp-vi.vs-ica-zoom,
.post-card-thumb-frame:hover > .ajp-vi.vs-ica-zoom,
.ajp-w-thumb:hover > .ajp-vi.vs-ica-zoom,
.apd-rel-thumb:hover > .ajp-vi.vs-ica-zoom,
.dz-related-card:hover > .ajp-vi.vs-ica-zoom,
.dz-article-featured:hover > .ajp-vi.vs-ica-zoom,
.dz-single-featured:hover > .ajp-vi.vs-ica-zoom,
.video-thumb-wrap:hover > .ajp-vi.vs-ica-zoom {
    scale: 1.12;
}

/* إظهار أيقونة «عند التمرير» على كل الحاويات */
.hpb-compact-thumb:hover > .ajp-vi.vs-icv-hover,
.hpb-overlay-img-link:hover > .ajp-vi.vs-icv-hover,
.hpb-mostread-thumb:hover > .ajp-vi.vs-icv-hover,
.hpb-hero-split-img:hover > .ajp-vi.vs-icv-hover,
.hpb-mosaic-img-link:hover > .ajp-vi.vs-icv-hover,
.hpb-rich-thumb:hover > .ajp-vi.vs-icv-hover,
.hpb-tl-thumb:hover > .ajp-vi.vs-icv-hover,
.hpb-stack-thumb:hover > .ajp-vi.vs-icv-hover,
.hpb-alt-thumb:hover > .ajp-vi.vs-icv-hover,
.hpb-photo-img-link:hover > .ajp-vi.vs-icv-hover,
.newsroom-side-thumb:hover > .ajp-vi.vs-icv-hover,
.newsroom-main-card > a:hover > .ajp-vi.vs-icv-hover,
.style-card-box > a:hover > .ajp-vi.vs-icv-hover,
.mag-card > a:hover > .ajp-vi.vs-icv-hover,
.hpb-hero-card > a:hover > .ajp-vi.vs-icv-hover,
.hpb-stack-feat > a:hover > .ajp-vi.vs-icv-hover,
.post-card-thumb:hover > .ajp-vi.vs-icv-hover,
.post-card-thumb-frame:hover > .ajp-vi.vs-icv-hover,
.ajp-w-thumb:hover > .ajp-vi.vs-icv-hover,
.apd-rel-thumb:hover > .ajp-vi.vs-icv-hover,
.dz-related-card:hover > .ajp-vi.vs-icv-hover,
.dz-article-featured:hover > .ajp-vi.vs-icv-hover,
.dz-single-featured:hover > .ajp-vi.vs-icv-hover,
.video-thumb-wrap:hover > .ajp-vi.vs-icv-hover {
    opacity: var(--vs-icon-op, 1);
    scale: 1;
}

/* تأثير الصعود من الأسفل (المتمركزة في المنتصف فقط) */
.hpb-compact-thumb:hover > .ajp-vi.vs-ica-rise,
.hpb-mostread-thumb:hover > .ajp-vi.vs-ica-rise,
.hpb-hero-split-img:hover > .ajp-vi.vs-ica-rise,
.hpb-rich-thumb:hover > .ajp-vi.vs-ica-rise,
.hpb-tl-thumb:hover > .ajp-vi.vs-ica-rise,
.hpb-stack-thumb:hover > .ajp-vi.vs-ica-rise,
.hpb-alt-thumb:hover > .ajp-vi.vs-ica-rise,
.hpb-photo-img-link:hover > .ajp-vi.vs-ica-rise,
.newsroom-main-card > a:hover > .ajp-vi.vs-ica-rise,
.style-card-box > a:hover > .ajp-vi.vs-ica-rise,
.mag-card > a:hover > .ajp-vi.vs-ica-rise,
.hpb-hero-card > a:hover > .ajp-vi.vs-ica-rise,
.hpb-stack-feat > a:hover > .ajp-vi.vs-ica-rise,
.post-card-thumb:hover > .ajp-vi.vs-ica-rise,
.post-card-thumb-frame:hover > .ajp-vi.vs-ica-rise,
.ajp-w-thumb:hover > .ajp-vi.vs-ica-rise,
.apd-rel-thumb:hover > .ajp-vi.vs-ica-rise,
.dz-related-card:hover > .ajp-vi.vs-ica-rise,
.dz-single-featured:hover > .ajp-vi.vs-ica-rise,
.dz-article-featured:hover > .ajp-vi.vs-ica-rise {
    translate: -50% calc(-50% - 4px);
}

/* تلوين الشكل عند تمرير البطاقة + استثناءات الأشكال الشفافة
   (نفس قائمة أقسام الفيديو) — والأيقونة الأصلية تحافظ على هويتها الحمراء */
.hpb-compact-thumb:hover > .ajp-vi,
.hpb-overlay-img-link:hover > .ajp-vi,
.hpb-mostread-thumb:hover > .ajp-vi,
.hpb-hero-split-img:hover > .ajp-vi,
.hpb-mosaic-img-link:hover > .ajp-vi,
.hpb-rich-thumb:hover > .ajp-vi,
.hpb-tl-thumb:hover > .ajp-vi,
.hpb-stack-thumb:hover > .ajp-vi,
.hpb-alt-thumb:hover > .ajp-vi,
.hpb-photo-img-link:hover > .ajp-vi,
.newsroom-side-thumb:hover > .ajp-vi,
.newsroom-main-card > a:hover > .ajp-vi,
.style-card-box > a:hover > .ajp-vi,
.mag-card > a:hover > .ajp-vi,
.hpb-hero-card > a:hover > .ajp-vi,
.hpb-stack-feat > a:hover > .ajp-vi,
.post-card-thumb:hover > .ajp-vi,
.post-card-thumb-frame:hover > .ajp-vi,
.ajp-w-thumb:hover > .ajp-vi,
.apd-rel-thumb:hover > .ajp-vi,
.dz-related-card:hover > .ajp-vi,
.dz-article-featured:hover > .ajp-vi,
.dz-single-featured:hover > .ajp-vi,
.video-thumb-wrap:hover > .ajp-vi {
    background-color: var(--vs-icon-bg-hover, var(--vs-accent));
    color: var(--vs-icon-color-hover, currentColor);
}
.hpb-compact-thumb:hover > .ajp-vi.vs-ic-play_glass,
.hpb-overlay-img-link:hover > .ajp-vi.vs-ic-play_glass,
.hpb-mostread-thumb:hover > .ajp-vi.vs-ic-play_glass,
.hpb-hero-split-img:hover > .ajp-vi.vs-ic-play_glass,
.hpb-rich-thumb:hover > .ajp-vi.vs-ic-play_glass,
.hpb-tl-thumb:hover > .ajp-vi.vs-ic-play_glass,
.hpb-stack-thumb:hover > .ajp-vi.vs-ic-play_glass,
.hpb-alt-thumb:hover > .ajp-vi.vs-ic-play_glass,
.hpb-photo-img-link:hover > .ajp-vi.vs-ic-play_glass,
.newsroom-side-thumb:hover > .ajp-vi.vs-ic-play_glass,
.newsroom-main-card > a:hover > .ajp-vi.vs-ic-play_glass,
.style-card-box > a:hover > .ajp-vi.vs-ic-play_glass,
.mag-card > a:hover > .ajp-vi.vs-ic-play_glass,
.hpb-hero-card > a:hover > .ajp-vi.vs-ic-play_glass,
.hpb-stack-feat > a:hover > .ajp-vi.vs-ic-play_glass,
.post-card-thumb:hover > .ajp-vi.vs-ic-play_glass,
.post-card-thumb-frame:hover > .ajp-vi.vs-ic-play_glass,
.ajp-w-thumb:hover > .ajp-vi.vs-ic-play_glass,
.apd-rel-thumb:hover > .ajp-vi.vs-ic-play_glass,
.dz-related-card:hover > .ajp-vi.vs-ic-play_glass,
.dz-single-featured:hover > .ajp-vi.vs-ic-play_glass,
.dz-article-featured:hover > .ajp-vi.vs-ic-play_glass,
.video-thumb-wrap:hover > .ajp-vi.vs-ic-play_glass {
    background-color: transparent;
}
/* الأيقونة الأصلية المستعادة: تفتيح أحمر خفيف عند التمرير — لا تحوّل ذهبي */
.ajp-vi.vs-ic-play_classic { color: #ffffff; }

/* المصغرات الصغيرة جداً: أيقونة تلقائية أصغر (نفس قاعدة الأقسام) */
.hpb-tl-thumb > .ajp-vi,
.hpb-compact-thumb > .ajp-vi,
.newsroom-side-thumb > .ajp-vi,
.apd-rel-thumb > .ajp-vi,
.dz-related-card > .ajp-vi {
    --vs-icon-size-d: min(var(--vs-icon-size-d, 44px), 34px);
}

/* احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .ajp-vi { transition: none !important; }
}

/* ---------- 3) أنماط لوحة التحكم (تُحمّل على صفحة الإعدادات فقط) ---------- */
.ajp-vi-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.ajp-vi-actions .ajp-ts-desc { margin: 0; }

.ajp-vi-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.ajp-vi-icon-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 8px 10px;
    text-align: center;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.ajp-vi-icon-card:hover {
    border-color: var(--primary-blue, #15406b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(8, 14, 24, .12);
}
.ajp-vi-icon-card.selected {
    border-color: var(--accent-gold, #d9822b);
    box-shadow: 0 0 0 3px rgba(217, 130, 43, .18);
}
.ajp-vi-icon-card.selected .ajp-vi-icon-name { color: var(--accent-gold, #d9822b); font-weight: 800; }
.ajp-vi-icon-demo {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #16324f 0%, #1d4568 55%, #2a5d8f 100%),
        #16324f;
    overflow: hidden;
    margin-bottom: 8px;
}
.ajp-vi-icon-demo .vs-play { position: static; translate: none; }
.ajp-vi-icon-demo .vs-ic-play_center_big,
.ajp-vi-icon-demo .vs-ic-play_screen,
.ajp-vi-icon-demo .vs-ic-play_film { scale: .82; }
.ajp-vi-icon-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ajp-vi-icon-card .button { font-size: 11px; padding: 2px 10px; min-height: 24px; line-height: 20px; }
.ajp-vi-demo-unified { opacity: .82; }

.ajp-vi-color-row { display: flex; align-items: center; gap: 6px; }
.ajp-vi-color-row .ajp-vi-color { flex: 1; min-width: 0; direction: ltr; text-align: center; }
.ajp-vi-color-row .ajp-vi-swatch { width: 38px; height: 32px; padding: 0; border: 1px solid #d0d5dd; border-radius: 4px; background: none; cursor: pointer; }

.ajp-vi-cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    max-height: 180px;
    overflow: auto;
}
.ajp-vi-cat-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }

/* المعاينة الحية — ثلاثة مشاهد بنفس CSS الموقع */
.ajp-vi-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    background: #0b1320;
    border-radius: 10px;
    padding: 16px;
}
.ajp-vi-scene { margin: 0; }
.ajp-vi-scene figcaption {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    text-align: center;
}
.ajp-vi-scene-media {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(140deg, #24507e 0%, #16324f 45%, #0e2239 100%),
        #16324f;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.ajp-vi-scene[data-vi-scene="thumb"] .ajp-vi-scene-media { height: 140px; }
.ajp-vi-scene[data-vi-scene="card"] .ajp-vi-scene-media { height: 110px; }
.ajp-vi-scene[data-vi-scene="player"] .ajp-vi-scene-media { height: 150px; }
/* عنصر المعاينة الزائف: عنوان بطاقة تحت الصورة في مشهد «بطاقة خبر» */
.ajp-vi-scene[data-vi-scene="card"] .ajp-vi-scene-media::after {
    content: '';
    position: absolute;
    inset-inline: 10px;
    bottom: 10px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 16px 0 rgba(255, 255, 255, .3);
}

/* شبكة اللوحة على الهاتف */
@media (max-width: 782px) {
    .ajp-vi-icons-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .ajp-vi-preview { grid-template-columns: 1fr; }
}
