/* ═══════════════════════════════════════════════════════════════
   TSC YouTube Playlists v3.5 — Bulletproof CSS
   Fixes grid gaps, card sizing, image stretching
   ═══════════════════════════════════════════════════════════════ */

/* ─── RESET: Kill any theme/elementor interference ─── */
.tsc-row,
.tsc-row *,
.tsc-tabbed,
.tsc-tabbed * {
    box-sizing: border-box;
}

/* ─── ROW CONTAINER ─── */
.tsc-row {
    margin-bottom: 56px;
    width: 100%;
}
.tsc-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}
.tsc-row-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}
.tsc-row-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tsc-text, #1A1A2E);
    margin: 0;
    transition: color 0.5s ease;
}
.tsc-row-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #E8A838, #C4501A);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    line-height: 1;
}

/* ─── NAV ARROWS ─── */
.tsc-row-nav {
    display: flex;
    gap: 8px;
}
.tsc-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    border: 1px solid var(--tsc-border, rgba(26,26,46,0.07));
    background: var(--tsc-toggle-bg, rgba(26,26,46,0.04));
    color: var(--tsc-text-sec, #4A4A68);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    font-size: 0;
    line-height: 0;
}
.tsc-nav-btn:hover {
    background: rgba(232,168,56,0.12);
    border-color: rgba(232,168,56,0.3);
    color: #E8A838;
}

/* ═══════════════════════════════════════
   SCROLL MODE (Horizontal Netflix row)
   ═══════════════════════════════════════ */
.tsc-layout-scroll .tsc-row-track {
    display: flex;
    gap: 18px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tsc-layout-scroll .tsc-row-track::-webkit-scrollbar {
    display: none;
}
.tsc-layout-scroll .tsc-row-track > .tsc-card {
    flex: 0 0 340px;
    width: 340px;
    max-width: 340px;
    scroll-snap-align: start;
}

/* ═══════════════════════════════════════
   GRID MODE — THE CRITICAL FIX
   ═══════════════════════════════════════ */
.tsc-layout-grid .tsc-row-track {
    display: grid !important;
    gap: 18px;
    padding: 0 20px;
    width: 100%;
}

/* Force every card in grid to fill its cell completely */
.tsc-layout-grid .tsc-row-track > .tsc-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
}

/* ═══════════════════════════════════════
   CARD — Equal height flex column
   ═══════════════════════════════════════ */
.tsc-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--tsc-card-bg, #FFFFFF);
    border: 1px solid var(--tsc-card-border, rgba(26,26,46,0.06));
    text-decoration: none !important;
    color: inherit;
    display: flex !important;
    flex-direction: column;
    height: 100%;
    transition: all 0.45s cubic-bezier(0.22,1,0.36,1);
}
.tsc-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--tsc-border-hover, rgba(232,168,56,0.25));
    box-shadow: 0 24px 48px var(--tsc-shadow-lg, rgba(26,26,46,0.1));
}

/* ═══════════════════════════════════════
   THUMBNAIL — Forces image to always fill
   ═══════════════════════════════════════ */
.tsc-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 fallback for browsers without aspect-ratio */
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--tsc-bg-alt, #f0f0f0);
    flex-shrink: 0;
}
.tsc-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.tsc-card:hover .tsc-card-thumb img {
    transform: scale(1.06);
}

/* ─── PLAY OVERLAY ─── */
.tsc-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background 0.3s;
}
.tsc-card:hover .tsc-play-overlay {
    background: rgba(0,0,0,0.2);
}
.tsc-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    color: #09090B;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
}
.tsc-card:hover .tsc-play-btn {
    opacity: 1;
    transform: scale(1);
}
.tsc-play-btn svg {
    margin-left: 2px;
}

/* ─── DURATION BADGE ─── */
.tsc-duration {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Outfit', -apple-system, sans-serif;
    line-height: 1.4;
    z-index: 2;
}

/* ═══════════════════════════════════════
   CARD BODY — flex grow, consistent height
   ═══════════════════════════════════════ */
.tsc-card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.tsc-card-title {
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--tsc-text, #1A1A2E);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.5s ease;
}
.tsc-card-meta {
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 12px;
    color: var(--tsc-text-ter, #8A8AA8);
    font-weight: 400;
    line-height: 1.4;
    transition: color 0.5s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: auto;
}

/* ─── ALL ROWS WRAPPER ─── */
.tsc-all-rows {
    padding: 20px 0;
    width: 100%;
}


/* ═══════════════════════════════════════
   RESPONSIVE — ROW WIDGET
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .tsc-row-header,
    .tsc-layout-scroll .tsc-row-track,
    .tsc-layout-grid .tsc-row-track {
        padding: 0 16px;
    }
    .tsc-layout-scroll .tsc-row-track > .tsc-card {
        flex: 0 0 300px;
        width: 300px;
        max-width: 300px;
    }
    .tsc-row-title {
        font-size: 22px;
    }
}
@media (max-width: 768px) {
    .tsc-row-header,
    .tsc-layout-scroll .tsc-row-track,
    .tsc-layout-grid .tsc-row-track {
        padding: 0 12px;
    }
    .tsc-layout-scroll .tsc-row-track > .tsc-card {
        flex: 0 0 260px;
        width: 260px;
        max-width: 260px;
    }
    .tsc-row-title { font-size: 20px; }
    .tsc-row-nav { display: none; }
    .tsc-layout-grid .tsc-row-track {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .tsc-layout-scroll .tsc-row-track > .tsc-card {
        flex: 0 0 240px;
        width: 240px;
        max-width: 240px;
    }
    .tsc-layout-grid .tsc-row-track {
        grid-template-columns: 1fr !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   TABBED PLAYLISTS WIDGET
   ═══════════════════════════════════════════════════════════════ */

.tsc-tabbed {
    width: 100%;
}

/* Header */
.tsc-tabs-header {
    text-align: center;
    margin-bottom: 32px;
}
.tsc-tabs-badge {
    display: inline-block;
    background: rgba(232,168,56,0.08);
    color: var(--tsc-gold, #B8860B);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 24px;
    border-radius: 40px;
    margin-bottom: 20px;
    font-family: 'Outfit', -apple-system, sans-serif;
    border: 1px solid rgba(232,168,56,0.12);
}
.tsc-tabs-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--tsc-text, #1A1A2E);
    margin: 0 0 14px;
    line-height: 1.1;
    transition: color 0.5s;
}
.tsc-tabs-sub {
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--tsc-text-sec, #4A4A68);
    max-width: 640px;
    margin: 0 auto;
    font-weight: 400;
    transition: color 0.5s;
}

/* Tab Navigation */
.tsc-tabs-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.tsc-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: 24px;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--tsc-text-sec, #4A4A68);
    border: 1.5px solid var(--tsc-border, rgba(26,26,46,0.1));
    transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
    white-space: nowrap;
}
.tsc-tab-btn:hover {
    background: rgba(232,168,56,0.06);
    border-color: rgba(232,168,56,0.25);
    color: var(--tsc-gold, #B8860B);
}
.tsc-tab-btn.tsc-active {
    background: var(--tsc-gold, #E8A838);
    color: #fff;
    border-color: var(--tsc-gold, #E8A838);
    box-shadow: 0 4px 16px rgba(232,168,56,0.25);
}
.tsc-tab-icon {
    font-size: 16px;
}

/* Panels */
.tsc-tab-panel {
    display: none;
    animation: tscFadeIn 0.4s ease;
}
.tsc-tab-panel.tsc-panel-active {
    display: block;
}
@keyframes tscFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tab Grid — same fix as row grid */
.tsc-tab-grid {
    display: grid !important;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}
.tsc-tab-grid > .tsc-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
}

/* Video badge */
.tsc-video-badge {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Outfit', -apple-system, sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

/* Hidden for load more */
.tsc-card.tsc-hidden {
    display: none !important;
}

/* Load More */
.tsc-load-more-wrap {
    text-align: center;
    margin-top: 32px;
}
.tsc-load-more {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 60px;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--tsc-gold, #E8A838);
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(232,168,56,0.2);
}
.tsc-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(232,168,56,0.3);
}

/* Description clamp */
.tsc-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
}

/* Responsive — Tabbed */
@media (max-width: 1024px) {
    .tsc-tab-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 768px) {
    .tsc-tab-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
    }
    .tsc-tabs-nav { gap: 8px; }
    .tsc-tab-btn { padding: 10px 20px; font-size: 13px; }
}
@media (max-width: 480px) {
    .tsc-tab-grid {
        grid-template-columns: 1fr !important;
    }
    .tsc-tab-btn { padding: 8px 16px; font-size: 12px; }
}
