/* discover.css */

.discover-tab-btn {
    padding-bottom: 0.5rem;
    transition: all 200ms;
    cursor: pointer;
}
.discover-tab-btn:not(.active):hover {
    color: #ef4444;
    border-bottom: 2px solid #fca5a5;
}
.discover-tab-btn.active {
    border-bottom: 2px solid #dc2626 !important;
}

.content-title {
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
    color: #0f172a;
}

.publisher-name {
    font-size: 0.95rem;
}

.info-line {
    font-size: 0.85rem;
}

.discover-video-card {
    background-color: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.discover-video-card > div {
    padding: 0.75rem;
}

.discover-video-card a[href] .publisher-name:hover {
    text-decoration: underline;
}

/* ========================================================================= */
/* 🛑 تصميم يوتيوب للموبايل (بدون أي هوامش أو فراغات بملء الشاشة) 🛑 */
/* ========================================================================= */

@media (max-width: 1023px) {
    /* إزالة المسافات من الحاويات الرئيسية للاقتراحات والمحتوى */
    #discover-content-container,
    #suggested-videos-container,
    #discover-suggested-list {
         padding: 0 !important;
         margin: 0 !important;
         width: 100% !important;
         max-width: 100% !important;
    }

    /* إزالة الفراغات (Gaps) بين الفيديوهات */
    #discover-content-container > div,
    #discover-suggested-list > div,
    .grid {
         gap: 0 !important;
         padding: 0 !important;
         margin: 0 !important;
    }

    /* كارت الفيديو نفسه بملء الشاشة وبدون حواف */
    .discover-full-bleed-item {
        background-color: white !important; 
        border-radius: 0 !important; 
        border-bottom: 4px solid #f3f4f6 !important; /* فاصل رمادي خفيف جداً بين الفيديوهات */
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        overflow: hidden !important;
        box-shadow: none !important;
        padding-bottom: 0 !important; 
        margin: 0 !important; 
        width: 100% !important;
        max-width: 100% !important;
    }

    .discover-full-bleed-item .relative.w-full.aspect-video,
    .discover-full-bleed-item .bg-gray-50\/50,
    .discover-full-bleed-item img {
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .discover-full-bleed-item .p-4.bg-white,
    .discover-full-bleed-item > div.flex.items-start {
        background-color: white !important; 
        padding: 12px 14px !important; 
        box-shadow: none !important;
    }
}

/* ========================================================================= */
/* ===== 🌟 شبكة فيديوهات الشاشات الكبيرة (كمبيوتر) 🌟 ===== */
/* ========================================================================= */

@media (min-width: 1024px) { 
    .discover-full-bleed-item {
        border-radius: 0.75rem !important; 
        border: 1px solid #e5e7eb !important;
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
        margin-bottom: 1rem !important; 
    }

    .discover-full-bleed-item .relative.w-full.aspect-video {
        border-radius: 0.75rem 0.75rem 0 0 !important; 
    }
}

/* ================================================= */
/* ===== Discover Player Styles ===== */
/* ================================================= */

.discover-player-controls-bar {
    height: 80px; 
    background-color: rgba(0, 0, 0, 0.8) !important; 
    backdrop-filter: none; 
    border-radius: 0;
}

.seek-btn-custom {
    border: none;
    cursor: pointer;
    background-color: transparent;
    color: white;
    box-shadow: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.rewind-btn-design, .forward-btn-design, .play-pause-btn-design {
    width: auto;
    height: auto;
    border-radius: 0;
    background-color: transparent !important;
    padding: 0;
    transform: none;
}

.rewind-btn-design:hover, .forward-btn-design:hover, .play-pause-btn-design:hover {
     background-color: rgba(255, 255, 255, 0.1); 
}

.discover-player-controls-bar .player-icon {
     filter: brightness(0) invert(1);
}

.discover-player-outer-frame:-webkit-full-screen {
    background-color: black;
}
.discover-player-outer-frame:-webkit-full-screen iframe,
.discover-player-outer-frame:-webkit-full-screen video {
    object-fit: contain !important;
}

.publisher-name,
.content-title,
.publisher-name-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    max-width: 100% !important;
    vertical-align: bottom;
}

.publisher-name-text {
    max-width: 150px !important; 
}

/* ========================================================================= */
/* 🌟 تصميم شبكة الشورتس / الريلز 🌟 */
/* ========================================================================= */
.shorts-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background-color: #fff;
    padding: 2px 0;
}

@media (min-width: 640px) {
    .shorts-grid-container { grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; }
}
@media (min-width: 1024px) {
    .shorts-grid-container { grid-template-columns: repeat(5, 1fr); }
}

.short-grid-item {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16; 
    background-color: #000;
    overflow: hidden;
    border-radius: 0 !important; 
}

.short-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.short-grid-item:hover img {
    transform: scale(1.05);
}

.short-grid-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 30%, transparent 100%);
    pointer-events: none;
}

.short-grid-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.short-grid-title {
    color: white !important;
    font-size: 13px !important;
    font-weight: bold;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal !important;
}

.short-grid-views {
    color: rgba(255,255,255,0.9);
    font-size: 11px;
    font-weight: 500;
}

.discover-player-controls-bar {
    height: auto !important;
    min-height: 80px;
    padding: 20px 10px 10px 10px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%) !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.discover-player-outer-frame .content-title {
    color: white !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    white-space: normal !important; 
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; 
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin-bottom: 8px !important; 
    text-shadow: 1px 1px 3px black;
    max-width: 100%;
}

.discover-player-outer-frame video {
    object-fit: contain !important; 
    background-color: black;
}