/* Podcasts - YouTube-Inspired Design System */

/* ===== Card Grid ===== */
.yt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 16px;
}

@media (max-width: 1200px) { .yt-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .yt-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; } }
@media (max-width: 480px) { .yt-grid { grid-template-columns: 1fr; } }

/* ===== Card ===== */
.yt-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.yt-card:hover {
    text-decoration: none;
    color: inherit;
}

.yt-card-thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-light);
}

.yt-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.yt-card:hover .yt-card-thumb img {
    transform: scale(1.05);
}

.yt-card-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.3px;
}

.yt-card-body {
    padding: 10px 2px 0 2px;
}

.yt-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-muted);
    margin-top: 4px;
    border: 1px solid var(--border-color);
}

/* ===== Filter Chips ===== */
.yt-chips-wrap {
    position: relative;
    padding: 12px 0 16px 0;
}

.yt-chips-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.15s, box-shadow 0.15s;
    font-size: 14px;
}

.yt-chips-arrow:hover {
    background: var(--bg-light);
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.yt-chips-arrow.left {
    left: 0;
}

.yt-chips-arrow.right {
    right: 0;
}

.yt-chips-arrow.hidden {
    display: none;
}

/* Fade edges when scrollable */
.yt-chips-wrap.can-scroll-left .yt-chips { mask-image: linear-gradient(to right, transparent 0px, black 40px, black calc(100% - 40px), transparent 100%); -webkit-mask-image: linear-gradient(to right, transparent 0px, black 40px, black calc(100% - 40px), transparent 100%); }
.yt-chips-wrap.can-scroll-left:not(.can-scroll-right) .yt-chips { mask-image: linear-gradient(to right, transparent 0px, black 40px); -webkit-mask-image: linear-gradient(to right, transparent 0px, black 40px); }
.yt-chips-wrap.can-scroll-right:not(.can-scroll-left) .yt-chips { mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%); -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%); }

.yt-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
    scroll-behavior: smooth;
}

.yt-chips::-webkit-scrollbar {
    display: none;
}

.yt-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    cursor: pointer;
}

.yt-chip:hover {
    background: var(--border-color);
    text-decoration: none;
    color: var(--text-dark);
}

.yt-chip.active {
    background: var(--text-dark);
    color: var(--bg-white);
    border-color: transparent;
}

.yt-chip.active:hover {
    opacity: 0.9;
    color: var(--bg-white);
}

[data-theme="dark"] .yt-chip.active {
    background: #e8e8e8;
    color: #1e1e1e;
}

/* ===== Hero ===== */
#pod-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

#pod-hero:hover {
    transform: scale(1.005);
    text-decoration: none;
    color: inherit;
}

#pod-hero-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
}

#pod-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 28px 24px 28px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
}

#pod-hero-badge {
    display: inline-block;
    background: #ea7066;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

#pod-hero-title {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

#pod-hero-desc {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#pod-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

#pod-hero-meta .badge {
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    font-weight: 500;
}

@media (max-width: 768px) {
    #pod-hero-img { height: 200px; }
    #pod-hero-title { font-size: 18px; }
    #pod-hero-overlay { padding: 40px 20px 18px 20px; }
}

@media (max-width: 480px) {
    #pod-hero-img { height: 160px; }
    #pod-hero-desc { display: none; }
}

@media (max-width: 768px) {
    #pod-hero { display: none; }
}

/* Hide first grid card on desktop (it's the hero) */
@media (min-width: 769px) {
    .yt-grid-hero .yt-card:first-child { display: none; }
}

/* ===== Section Headers ===== */
.pod-section {
    margin-bottom: 40px;
}

.pod-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pod-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pod-section-title i {
    color: #ea7066;
    font-size: 16px;
}

.pod-section-link {
    font-size: 14px;
    font-weight: 600;
    color: #84bed6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.pod-section-link:hover {
    color: #ea7066;
    text-decoration: none;
}

/* ===== Stats Bar ===== */
.pod-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 8px;
    padding: 12px 0;
}

.pod-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pod-stat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.pod-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.2;
}

/* ===== News Feature ===== */
#pod-news {
    background: linear-gradient(135deg, #fef3f2 0%, #fff7ed 50%, #fef9ec 100%);
    border-radius: 12px;
    padding: 28px;
}

[data-theme="dark"] #pod-news {
    background: linear-gradient(135deg, #2a1f1e 0%, #2a2318 50%, #2a2510 100%);
}

#pod-news .pod-section-title {
    color: #ea7066;
}

/* ===== Subject Chips ===== */
.pod-subjects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pod-subject-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 10px;
    border-radius: 50px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.pod-subject-chip:hover {
    border-color: #84bed6;
    background: #84bed6;
    color: #fff;
    text-decoration: none;
}

.pod-subject-chip-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.pod-subject-chip-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 2px;
}

.pod-subject-chip:hover .pod-subject-chip-count {
    color: rgba(255,255,255,0.8);
}

/* ===== Topic Pills ===== */
.pod-topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pod-topic-pill {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-body);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.pod-topic-pill:hover {
    border-color: #ea7066;
    color: #ea7066;
    text-decoration: none;
}

.pod-topic-pill-count {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 4px;
}

/* ===== Search Bar ===== */
.pod-search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 20px;
    gap: 10px;
    transition: border-color 0.2s;
}

.pod-search-bar:focus-within {
    border-color: #84bed6;
}

.pod-search-bar i {
    color: var(--text-muted);
    font-size: 14px;
}

.pod-search-bar input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
}

.pod-search-bar input::placeholder {
    color: var(--text-muted);
}

.pod-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pod-count-badge strong {
    color: var(--text-dark);
}

/* ===== Player Page - Two Column Layout ===== */
.yt-player-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.yt-player-primary {
    flex: 1;
    min-width: 0;
}

.yt-player-secondary {
    flex: 0 0 360px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

@media (max-width: 992px) {
    .yt-player-layout {
        flex-direction: column;
    }
    .yt-player-secondary {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
    }
}

/* ===== Video Area (Subtitle Display) ===== */
.yt-video-area {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 420px;
    background: #0f0f0f;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Orb visualisation */
.yt-video-orb {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #0f0f0f;
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.35);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-video-orb-logo {
    margin-top: 10px;
    width: 50%;
    height: 50%;
    object-fit: contain;
    opacity: 0.7;
}

/* Hide orb while loading */
.yt-video-area:has(.subtitles-loading-message:not([style*="display: none"])) .yt-video-orb {
    display: none;
}

/* Playing state - pulse glow */
.yt-video-area.playing .yt-video-orb {
    animation: orbPulse 3s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(0, 170, 255, 0.35); transform: translate(-50%, -50%) scale(1); }
    50% { box-shadow: 0 0 70px rgba(0, 170, 255, 0.6); transform: translate(-50%, -50%) scale(1.06); }
}

@media (max-width: 768px) {
    .yt-video-orb { width: 120px; height: 120px; top: 50%; }
    .yt-video-area .subtitles-content { display: none !important; }
    .yt-video-area .nighttime-mode-message { display: none !important; }
    .nighttime-controls { display: none !important; }
}

@media (max-width: 480px) {
    .yt-video-orb { width: 100px; height: 100px; }
}

.yt-video-area .subtitles-loading-message,
.yt-video-area .nighttime-mode-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2;
}

.yt-video-area .subtitles-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
}

.yt-video-area .subtitle-line {
    font-size: 20px;
    color: #fff;
    font-weight: 500;
    line-height: 1.5;
    padding: 0 24px;
    max-width: 90%;
    transition: opacity 0.2s ease;
}

.yt-video-area .subtitle-line.active {
    color: #84BED6;
    font-weight: 600;
}

.yt-video-area .subtitle-word {
    display: inline;
    transition: color 0.15s ease;
}

.yt-video-area .subtitle-word.current-word {
    color: #84BED6;
    background: rgba(132, 190, 214, 0.15);
    border-radius: 3px;
    padding: 0 2px;
}

.yt-video-area .next-line {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
    margin-top: 8px;
}

.yt-video-area .subtitles-loading-message {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.yt-video-area .subtitles-loading-message .spinner-border {
    width: 24px;
    height: 24px;
    border-width: 2px;
    color: rgba(255, 255, 255, 0.3);
}

.yt-video-area .nighttime-mode-message {
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
}

@media (max-width: 768px) {
    .yt-video-area .subtitle-line { font-size: 18px; }
    .yt-video-area .next-line { font-size: 14px; }
}

@media (max-width: 480px) {
    .yt-video-area .subtitle-line { font-size: 16px; padding: 0 16px; }
    .yt-video-area .next-line { font-size: 13px; }
}

/* ===== Player Controls Bar ===== */
.yt-controls-bar {
    padding: 0;
    margin-top: -2px;
}

/* Progress bar - thin line that expands on hover like YouTube */
.yt-progress-wrap {
    position: relative;
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.yt-progress-track {
    width: 100%;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    position: relative;
    transition: height 0.15s ease;
}

.yt-progress-wrap:hover .yt-progress-track {
    height: 5px;
}

.yt-progress-fill {
    height: 100%;
    background: #ea7066;
    border-radius: 2px;
    position: relative;
    width: 0%;
    transition: none;
}

.yt-progress-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    background: #ea7066;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.yt-progress-wrap:hover .yt-progress-handle {
    transform: translateY(-50%) scale(1);
}

/* Controls row */
.yt-controls-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    gap: 8px;
}

.yt-ctrl-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-size: 16px;
}

.yt-ctrl-btn:hover {
    background: var(--bg-light);
}

.yt-ctrl-btn.play-btn {
    font-size: 28px;
    padding: 6px;
}

.yt-ctrl-time {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Roboto Mono', monospace;
    margin-left: 8px;
    white-space: nowrap;
}

.yt-ctrl-spacer {
    flex: 1;
}

/* ===== Player Info ===== */
.yt-player-info {
    padding: 12px 0;
}

.yt-player-info h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.yt-player-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yt-player-desc {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.6;
    margin: 0;
}

/* ===== Related Sidebar ===== */
.yt-related-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.yt-related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.yt-related-card {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    padding: 4px;
    transition: background 0.15s;
}

.yt-related-card:hover {
    background: var(--bg-light);
    text-decoration: none;
    color: inherit;
}

.yt-related-thumb {
    flex: 0 0 168px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-light);
}

.yt-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-related-body {
    flex: 1;
    min-width: 0;
    padding: 2px 0;
}

.yt-related-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.35;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-related-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 992px) {
    .yt-related-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .yt-related-card {
        flex-direction: column;
    }
    .yt-related-thumb {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .yt-related-list {
        grid-template-columns: 1fr;
    }
}

/* ===== Share Section ===== */
.podcast-share {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}
