/* ═══════════════════════════════════════════════════════════════
   Video Page — YouTube-style (Phase 1)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Grid ویدئوها (صفحه لیست) ─── */
.mbs-video-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 24px 0;
    direction: rtl;
}

@media (max-width: 768px) {
    .mbs-video-grid-pro {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ─── کارت ویدئو ─── */
.mbs-video-card-pro {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.mbs-video-card-pro:hover {
    transform: translateY(-2px);
}

/* ─── Thumbnail ─── */
.mbs-video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
}

.mbs-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.mbs-video-card-pro:hover .mbs-video-thumb img {
    transform: scale(1.05);
}

.mbs-video-thumb-placeholder {
    opacity: 0.4;
}

/* ─── Badge مدت زمان ─── */
.mbs-video-duration {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    direction: ltr;
    z-index: 2;
}

/* ─── Overlay Play Icon ─── */
.mbs-video-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 1;
}

.mbs-video-card-pro:hover .mbs-video-play-overlay {
    opacity: 1;
}

.mbs-video-play-overlay__icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.25s;
}

.mbs-video-card-pro:hover .mbs-video-play-overlay__icon {
    transform: scale(1);
}

/* ─── در حالت پخش inline ─── */
.mbs-video-thumb.is-playing {
    padding: 0;
    background: #000;
}

.mbs-video-thumb.is-playing video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.mbs-video-thumb.is-playing .mbs-video-play-overlay,
.mbs-video-thumb.is-playing img,
.mbs-video-thumb.is-playing .mbs-video-duration {
    display: none;
}

/* ─── اطلاعات کارت (زیر ویدئو) ─── */
.mbs-video-meta {
    display: flex;
    gap: 12px;
    padding: 12px 4px 0;
    direction: rtl;
    text-decoration: none;
    color: inherit;
}

.mbs-video-meta__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.mbs-video-meta__body {
    flex: 1;
    min-width: 0;
}

.mbs-video-meta__title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mbs-video-meta__sub {
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.mbs-video-meta__sub .dot {
    opacity: 0.6;
}

/* ─── دکمه‌های روی کارت ─── */
.mbs-video-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.25s;
}

.mbs-video-card-pro:hover .mbs-video-card-actions {
    opacity: 1;
}

.mbs-video-card-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #334155;
    transition: all 0.2s;
    text-decoration: none;
}

.mbs-video-card-action:hover {
    background: #fff;
    transform: scale(1.1);
}

.mbs-video-card-action .material-symbols-rounded {
    font-size: 18px !important;
}

/* ═══ Picture-in-Picture ═══ */
.mbs-video-pip-button {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 4;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s;
}

.mbs-video-thumb.is-playing .mbs-video-pip-button {
    opacity: 1;
}

.mbs-video-pip-button:hover {
    background: #ef4444;
}

.mbs-video-pip-button .material-symbols-rounded {
    font-size: 20px !important;
}

/* ═══ Hero صفحه ویدئو ═══ */
.mbs-video-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e8ecf5;
    margin-bottom: 20px;
    direction: rtl;
}

.mbs-video-hero__icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.3);
}

.mbs-video-hero__title {
    font-size: 26px;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.mbs-video-hero__sub {
    font-size: 14px;
    color: #64748b;
    margin: 4px 0 0;
}

/* ═══ Empty ═══ */
.mbs-video-empty {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
    direction: rtl;
}

.mbs-video-empty__icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.mbs-video-empty__title {
    font-size: 20px;
    font-weight: 800;
    color: #334155;
    margin: 0 0 8px;
}

.mbs-video-empty__desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.9;
    margin: 0;
}

/* ═══ Media Query ═══ */
@media (max-width: 768px) {
    .mbs-video-hero {
        gap: 12px;
        padding: 16px 0;
    }
    .mbs-video-hero__icon {
        width: 52px;
        height: 52px;
    }
    .mbs-video-hero__title {
        font-size: 20px;
    }
    .mbs-video-hero__sub {
        font-size: 12px;
    }
    .mbs-video-meta__title {
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   App-style Icons — آیکون‌های رنگی با gradient
   ═══════════════════════════════════════════════════════════════ */

.mbs-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.mbs-app-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 60%);
    pointer-events: none;
}

.mbs-app-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    position: relative;
    z-index: 1;
}

/* ─── رنگ‌ها ─── */
.mbs-app-icon--video   { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.mbs-app-icon--share   { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.mbs-app-icon--eye     { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.mbs-app-icon--calendar{ background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.mbs-app-icon--clock   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.mbs-app-icon--play    { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.mbs-app-icon--pip     { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.mbs-app-icon--link    { background: linear-gradient(135deg, #10b981, #059669); }

/* ─── سایز کوچک ─── */
.mbs-app-icon--sm {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}
.mbs-app-icon--sm svg {
    width: 18px;
    height: 18px;
}

/* ─── سایز بزرگ ─── */
.mbs-app-icon--lg {
    width: 72px;
    height: 72px;
    border-radius: 20px;
}
.mbs-app-icon--lg svg {
    width: 36px;
    height: 36px;
}

/* ═══ Override Hero Icon ═══ */
.mbs-video-hero__icon {
    width: 72px !important;
    height: 72px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.3) !important;
}

.mbs-video-hero__icon svg {
    width: 36px !important;
    height: 36px !important;
}

/* ═══ Override meta item icons ═══ */
.mbs-video-info__meta-item .mbs-app-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}
.mbs-video-info__meta-item .mbs-app-icon svg {
    width: 16px;
    height: 16px;
}

/* ═══ دکمه‌های اشتراک ═══ */
.mbs-video-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px 8px 12px !important;
    border-radius: 100px !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    transition: all 0.2s !important;
}

.mbs-video-action-btn:hover {
    background: #e2e8f0 !important;
    transform: translateY(-2px);
}
