/* ==========================================================================
   SAFHAAT VIDEO LIBRARY STYLES (REKHTA / YOUTUBE HYBRID ARCHITECTURE)
   ========================================================================== */

.video-library-page {
    background-color: #faf6f0;
    color: #1a1a1a;
    padding-bottom: 60px;
}

.library-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --------------------------------------------------------------------------
   1. DESKTOP HERO BANNER (REKHTA SUNDAY SPECIAL STYLE)
   -------------------------------------------------------------------------- */
.desktop-hero-banner {
    width: 100%;
    margin-bottom: 40px;
}

.hero-banner-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    background-color: #000;
}

.hero-banner-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
}

.hero-overlay-content {
    position: absolute;
    bottom: 40px;
    left: 60px;
    max-width: 600px;
    color: #ffffff;
    z-index: 2;
}

.hero-badge {
    background: #c9a050;
    color: #000000;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    letter-spacing: 1px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 12px;
}

.hero-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.15;
    color: #ffffff;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 15px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.hero-watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #000000;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.hero-watch-btn:hover {
    background: #c9a050;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   2. MOBILE FEATURED VIDEO HERO (YOUTUBE MOBILE HOME FEED STYLE)
   -------------------------------------------------------------------------- */
.mobile-featured-hero {
    padding: 15px 15px 25px 15px;
    background: #ffffff;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 25px;
}

.mobile-video-card .mobile-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.mobile-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-video-meta {
    padding-top: 12px;
}

.featured-tag {
    font-size: 10px;
    font-weight: 700;
    color: #c9a050;
    letter-spacing: 1px;
}

.mobile-video-meta h2 {
    font-family: Georgia, serif;
    font-size: 18px;
    margin: 4px 0;
    color: #1a1a1a;
}

.mobile-video-meta p {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
}

.mobile-watch-btn {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. SECTION HEADINGS & COMMON GRID ELEMENTS
   -------------------------------------------------------------------------- */
.library-section {
    margin-top: 35px;
    margin-bottom: 35px;
}

.section-header-block {
    margin-bottom: 20px;
}

.section-heading {
    font-family: Georgia, serif;
    font-size: 22px;
    color: #1a1a1a;
    margin: 0 0 5px 0;
    letter-spacing: 0.5px;
}

.section-subheading {
    font-size: 13px;
    color: #666666;
    margin: 0;
}

.vid-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

/* --------------------------------------------------------------------------
   4. PLAYLISTS GRID (LARGE 16:9 THUMBNAILS)
   -------------------------------------------------------------------------- */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.playlist-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.playlist-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.thumb-16x9 {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    overflow: hidden;
}

.thumb-16x9 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-badge-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 12px 12px 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.playlist-details {
    padding: 15px;
}

.playlist-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-family: Georgia, serif;
}

.playlist-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.playlist-title a:hover {
    color: #c9a050;
}

.playlist-meta {
    font-size: 12px;
    color: #777777;
    margin: 0;
}

/* --------------------------------------------------------------------------
   5. INDIVIDUAL VIDEOS GRID (SMALLER 16:9 THUMBNAILS)
   -------------------------------------------------------------------------- */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.video-item-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.video-item-card:hover {
    border-color: #c9a050;
}

.thumb-16x9-small {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.thumb-16x9-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-item-details {
    padding: 12px;
}

.video-item-title {
    font-size: 14px;
    margin: 0 0 5px 0;
    font-family: Georgia, serif;
    line-height: 1.35;
}

.video-item-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.video-item-meta {
    font-size: 11px;
    color: #888888;
    margin: 0;
}

/* ==========================================================================
   EXPLICIT RESPONSIVE DISPLAY TOGGLES
   ========================================================================== */

/* Desktop Default (768px and above) */
@media (min-width: 768px) {
    .desktop-hero-banner {
        display: block !important;
    }
    .mobile-featured-hero {
        display: none !important;
    }
}

/* Mobile Screens (Under 768px) */
@media (max-width: 767px) {
    .desktop-hero-banner {
        display: none !important;
    }
    .mobile-featured-hero {
        display: block !important;
    }
}


/* ==========================================================================
   MASTER WATCH PAGE STYLES
   ========================================================================== */

.watch-page-main {
    padding-top: 30px;
    padding-bottom: 60px;
    background-color: #faf6f0;
}

.watch-hero-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 25px;
    align-items: start;
}

/* 16:9 Responsive Player Frame */
.iframe-16x9-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.iframe-16x9-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.watch-video-header {
    margin-top: 15px;
}

.series-tag {
    font-size: 11px;
    font-weight: 700;
    color: #c9a050;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.watch-title {
    font-family: Georgia, serif;
    font-size: 22px;
    margin: 6px 0 12px 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.watch-meta-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #e0dcd5;
    padding-bottom: 15px;
}

.yt-subscribe-btn {
    margin-left: auto;
    background: #cc0000;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
}

/* Playlist Sidebar Box */
.playlist-box {
    background: #ffffff;
    border: 1px solid #e0dcd5;
    border-radius: 8px;
    overflow: hidden;
}

.playlist-box-header {
    padding: 15px;
    background: #1a1a1a;
    color: #ffffff;
}

.playlist-box-header h3 {
    font-family: Georgia, serif;
    font-size: 15px;
    margin: 0 0 3px 0;
}

.playlist-box-header p {
    font-size: 11px;
    color: #bbb;
    margin: 0;
}

.playlist-items-scroll {
    max-height: 480px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px;
    text-decoration: none;
    color: #1a1a1a;
    border-bottom: 1px solid #f0ece6;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: #f5f0e8;
}

.playlist-item.active {
    background: #eae2d5;
    border-left: 3px solid #c9a050;
}

.item-num {
    font-size: 12px;
    font-weight: bold;
    color: #888;
    width: 20px;
}

.item-thumb {
    width: 140px;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info h4 {
    font-size: 12px;
    font-family: Georgia, serif;
    margin: 0 0 2px 0;
    line-height: 1.25;
}

.item-info small {
    font-size: 10px;
    color: #777;
}

/* Content Sections (Script, Farhang, Commentary) */
.content-left-col {
    max-width: 800px;
}

.content-heading {
    font-family: Georgia, serif;
    font-size: 18px;
    color: #1a1a1a;
    border-bottom: 1px solid #c9a050;
    padding-bottom: 6px;
    margin: 30px 0 15px 0;
}

.script-couplet {
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #e0dcd5;
    margin-bottom: 12px;
}

.line-hindi {
    font-size: 16px;
    margin: 0 0 4px 0;
    font-family: Georgia, serif;
}

.line-urdu {
    font-size: 18px;
    direction: rtl;
    color: #555;
    margin: 6px 0 0 0;
    font-family: 'NastaLiq', Georgia, serif;
}

/* Farhang Table */
.farhang-table-wrapper {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0dcd5;
    overflow: hidden;
}

.farhang-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.farhang-table th {
    background: #1a1a1a;
    color: #fff;
    padding: 10px 15px;
    text-align: left;
    font-size: 13px;
}

.farhang-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.commentary-box {
    background: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #e0dcd5;
    line-height: 1.6;
    font-size: 14px;
}

/* Responsive Toggles */
@media (max-width: 991px) {
    .watch-hero-grid {
        grid-template-columns: 1fr;
    }
    .playlist-items-scroll {
        max-height: 250px;
    }
}


/* ==========================================================================
   MOBILE LAYOUT FIXES FOR MASTER WATCH PAGE (WATCH.PHP)
   ========================================================================== */

@media (max-width: 767px) {
    
    .watch-page-main {
        padding-top: 15px;
        padding-bottom: 40px;
    }

    /* Stack grid elements and clear gaps */
    .watch-hero-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    /* Full-width player fix */
    .main-player-col {
        width: 100%;
    }

    .iframe-16x9-wrapper {
        border-radius: 6px;
    }

    /* Title & Meta spacing */
    .watch-title {
        font-size: 18px;
        line-height: 1.35;
        margin: 8px 0 10px 0;
    }

    .watch-meta-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
        padding-bottom: 12px;
    }

    .yt-subscribe-btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
        padding: 8px 0;
        margin-top: 4px;
    }

    /* Compact Mobile Playlist Drawer */
    .playlist-sidebar-col {
        width: 100%;
    }

    .playlist-box {
        border-radius: 6px;
    }

    .playlist-box-header {
        padding: 10px 12px;
    }

    .playlist-items-scroll {
        max-height: 350px;
    }

    .playlist-item {
        padding: 8px 8px;
    }

    .item-thumb {
        width: 160px;
    }

    .item-info h4 {
        font-size: 12px;
    }

    /* Text & Farhang Table Mobile Fixes */
    .content-left-col {
        width: 100%;
    }

    .content-heading {
        font-size: 16px;
        margin: 20px 0 10px 0;
    }

    .script-couplet {
        padding: 12px 14px;
    }

    .line-hindi {
        font-size: 14px;
    }

    .line-urdu {
        font-size: 16px;
    }

    /* Prevent Farhang Table overflow on small screens */
    .farhang-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .farhang-table th, 
    .farhang-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .commentary-box {
        padding: 12px 14px;
        font-size: 13px;
    }
}


/* ==========================================================================
   YOUTUBE MOBILE STYLE EXPANDABLE DESCRIPTION BOX
   ========================================================================== */

.expandable-desc-box {
    background: #eae2d5;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 12px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.desc-preview-text {
    font-size: 13px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.desc-more-btn {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 12px;
    margin-left: 6px;
}

.desc-full-content {
    display: none;
    margin-top: 10px;
    border-top: 1px dashed #c9a050;
    padding-top: 10px;
}

.expandable-desc-box.is-expanded .desc-full-content {
    display: block;
}

.expandable-desc-box.is-expanded .desc-preview-text {
    display: none;
}

.desc-less-btn {
    margin-top: 15px;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-align: right;
    cursor: pointer;
}

.subscribe-action-wrapper {
    margin-top: 12px;
    margin-bottom: 20px;
}

.subscribe-action-wrapper .yt-subscribe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #cc0000;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    width: 100%;
}

/* Desktop behavior: Keep description expanded natively on larger screens */
@media (min-width: 992px) {
    .expandable-desc-box {
        background: transparent;
        padding: 0;
        cursor: default;
    }
    .desc-preview-text, .desc-less-btn {
        display: none !important;
    }
    .desc-full-content {
        display: block !important;
        border-top: none;
        padding-top: 0;
    }
    .subscribe-action-wrapper {
        width: auto;
        display: inline-block;
    }
    .subscribe-action-wrapper .yt-subscribe-btn {
        width: auto;
    }
}



/* Desktop View: Show full lower text section, hide mobile expandable box */
@media (min-width: 992px) {
    .expandable-desc-box {
        display: none !important;
    }
    .watch-content-grid {
        display: block !important;
    }
}

/* Mobile View: Show expandable box, hide desktop lower section */
@media (max-width: 991px) {
    .expandable-desc-box {
        display: block !important;
    }
    .watch-content-grid {
        display: none !important;
    }
}


/* UPCOMING SERIES PLACEHOLDER */
.upcoming-series-hero {
    width: 100%;
    margin-bottom: 2.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #111111;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.upcoming-poster-wrapper {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upcoming-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
    filter: blur(4px);
}

.upcoming-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 680px;
}

.upcoming-badge {
    background: #d4af37;
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 1rem;
}

.upcoming-title {
    font-family: 'Cinzel', 'Rozha One', serif;
    font-size: 2.2rem;
    color: #faf6f0;
    margin-bottom: 0.8rem;
}

.upcoming-desc {
    color: #cccccc;
    font-size: 1.05rem;
    margin-bottom: 1.8rem;
}

.cta-notice {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* UPCOMING BACK BUTTON STYLES */
.upcoming-back-wrapper {
    margin-top: 1.25rem;
}

.upcoming-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #d4af37;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    opacity: 0.85;
}

.upcoming-back-btn:hover {
    color: #ffffff;
    opacity: 1;
    transform: translateX(-3px);
}

.upcoming-back-btn i {
    font-size: 1.2rem;
}

/* ==========================================
   YOUTUBE ACTION BAR STYLES
   ========================================== */

.yt-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

/* LEFT: CHANNEL INFO + SUBSCRIBE */
.channel-info-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #faf6f0; /* Changed from #111111 */
    border: 2px solid rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.channel-text {
    display: flex;
    flex-direction: column;
}

.channel-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #111111;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.verified-badge {
    color: #717171;
    font-size: 0.9rem;
}

.channel-subtext {
    font-size: 0.82rem;
    color: #606060;
}

.yt-sub-btn-red {
    background: #cc0000;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 18px;
    text-decoration: none;
    margin-left: 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.yt-sub-btn-red:hover {
    background: #990000;
    color: #ffffff;
    transform: translateY(-1px);
}

/* RIGHT: ACTION PILLS */
.action-buttons-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.05);
    color: #0f0f0f;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 18px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.action-pill-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f0f0f;
}

.action-pill-btn i {
    font-size: 1.05rem;
}

/* MOBILE RESPONSIVE */
@media (max-width: 576px) {
    .yt-action-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .action-buttons-group {
        width: 100%;
        justify-content: flex-start;
    }
}