/* ============================================
   Podcasts – Corporate Memphis style
   Matches index.css design language
   ============================================ */

body {
    overflow-x: hidden;
    position: relative;
}

/* ---- Shared background (same as index) ---- */
.memphis-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.blob-1 {
    width: 500px; height: 500px;
    background: var(--amber);
    top: -120px; right: -100px;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-2 {
    width: 400px; height: 400px;
    background: var(--sky);
    bottom: -80px; left: -80px;
    animation: blobFloat 25s ease-in-out infinite reverse;
}

.blob-3 {
    width: 300px; height: 300px;
    background: var(--lavender);
    top: 50%; left: 60%;
    animation: blobFloat 18s ease-in-out infinite 5s;
}

.grid-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(26,26,46,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(30px,-20px) scale(1.05); }
    66% { transform: translate(-20px,15px) scale(0.95); }
}

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    position: relative;
}

/* ---- Header (same as index) ---- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

.pill-btn:hover {
    border-color: var(--sky);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.pill-btn .icon-sm { opacity: 0.7; }

.pill-label {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Podcast List Section ---- */
.podcast-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-card);
    animation: cardEnter 0.6s ease-out;
    margin-bottom: 48px;
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.podcast-list-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.podcast-list-header h2 {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.history-decoration {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--amber) 0%, var(--coral) 33%, var(--lavender) 66%, var(--sky) 100%);
    opacity: 0.4;
}

.podcast-list-subtitle {
    color: var(--text-tertiary);
    font-size: 0.92em;
    margin-bottom: 24px;
}

/* Loading state */
.podcast-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 0;
}

.podcast-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--bg-subtle);
    border-top-color: var(--sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.podcast-loading p,
.podcast-empty p {
    color: var(--text-tertiary);
    font-size: 0.95em;
    font-style: italic;
}

/* Podcast grid */
.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.podcast-item {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.podcast-item:hover {
    background: #fff;
    border-color: var(--border);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.podcast-item__icon-wrap {
    width: 48px; height: 48px;
    background: var(--sky);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.podcast-item__icon {
    width: 26px; height: 26px;
    filter: brightness(0) invert(1);
}

.podcast-item__meta {
    flex: 1;
    min-width: 0;
}

.podcast-item__label {
    font-weight: 700;
    font-size: 0.98em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podcast-item__play {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.podcast-item:hover .podcast-item__play {
    background: var(--sky);
    border-color: var(--sky);
}

.podcast-item__play img {
    width: 20px; height: 20px;
    filter: brightness(0);
    opacity: 0.55;
}

.podcast-item:hover .podcast-item__play img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* ---- Player Section ---- */
.player-section {
    animation: cardEnter 0.4s ease-out;
}

.player-top-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.player-back {
    width: 40px; height: 40px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-back:hover {
    border-color: var(--sky);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.back-arrow {
    transform: rotate(180deg);
}

.player-title {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Video card */
.podcast-player-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    margin-bottom: 48px;
}

.video-wrap {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
}

.video-wrap video {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: block;
    object-fit: contain;
    background: #000;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 5;
}

.video-overlay .podcast-spinner {
    border-color: rgba(255,255,255,0.15);
    border-top-color: #fff;
    width: 36px; height: 36px;
}

.video-overlay p {
    color: rgba(255,255,255,0.7);
    font-size: 0.92em;
    font-style: normal;
}

/* ---- Controls tray (lives inside video-wrap) ---- */
.controls-tray {
    position: relative;
    z-index: 4;
    background: var(--bg-card);
    flex-shrink: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Controls bar */
.podcast-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 10px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctrl-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: var(--bg-card);
    border-color: var(--sky);
    box-shadow: var(--shadow-sm);
}

.ctrl-btn img {
    width: 22px; height: 22px;
    filter: brightness(0);
    opacity: 0.7;
}

.ctrl-btn:hover img {
    opacity: 1;
}

.podcast-time {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    user-select: none;
    display: flex;
    gap: 3px;
}

.time-sep { opacity: 0.4; }

/* Volume control (hover slider) */
.volume-control {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.25s ease, opacity 0.2s ease;
}

.volume-control:hover .volume-slider-container {
    max-width: 140px;
    opacity: 1;
}

.volume-slider {
    width: 80px;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.volume-slider-fill {
    height: 100%;
    background: var(--sky);
    border-radius: 3px;
    width: 100%;
    position: relative;
}

.volume-slider-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px; height: 12px;
    background: #fff;
    border: 2px solid var(--sky);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.volume-percentage {
    font-size: 0.78em;
    color: var(--text-tertiary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    white-space: nowrap;
}

/* Custom caption overlay (positioned inside player-card, over video area) */
.custom-caption-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 70px;
    z-index: 10;
    pointer-events: none;
}

.custom-caption-overlay span {
    display: inline;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.6;
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    max-width: 80%;
    text-align: center;
}

/* Volume OSD (centered popup in video) */
.volume-osd {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.75);
    border-radius: 16px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.volume-osd.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.volume-osd-icon {
    width: 28px; height: 28px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.volume-osd-text {
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Seek bar */
.seek-bar-wrap {
    padding: 0 20px;
}

.seek-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.seek-bar-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(26, 26, 46, 0.12);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    z-index: 0;
}

.seek-bar-fill {
    height: 100%;
    background: var(--sky);
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
    z-index: 1;
}

.seek-bar-thumb {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    background: #fff;
    border: 2px solid var(--sky);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
    opacity: 0;
}

.seek-bar:hover .seek-bar-thumb {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

/* ---- Fullscreen state (JS class) ---- */
.video-wrap.is-fullscreen {
    aspect-ratio: unset;
}

.video-wrap.is-fullscreen .controls-tray {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding-top: 32px;
}

.video-wrap.is-fullscreen .controls-tray.hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.video-wrap.is-fullscreen .podcast-controls {
    padding: 6px 28px 14px;
}

.video-wrap.is-fullscreen .seek-bar-wrap {
    padding: 0 28px;
}

.video-wrap.is-fullscreen .ctrl-btn {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

.video-wrap.is-fullscreen .ctrl-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.4);
}

.video-wrap.is-fullscreen .ctrl-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.video-wrap.is-fullscreen .ctrl-btn:hover img {
    opacity: 1;
}

.video-wrap.is-fullscreen .podcast-time {
    color: rgba(255,255,255,0.85);
}

.video-wrap.is-fullscreen .time-sep {
    opacity: 0.4;
}

.video-wrap.is-fullscreen .seek-bar {
    background: rgba(255,255,255,0.2);
}

.video-wrap.is-fullscreen .seek-bar-buffer {
    background: rgba(255,255,255,0.2);
}

.video-wrap.is-fullscreen .seek-bar-thumb {
    border-color: #fff;
}

.video-wrap.is-fullscreen .volume-slider {
    background: rgba(255,255,255,0.2);
}

.video-wrap.is-fullscreen .volume-slider-thumb {
    border-color: #fff;
}

.video-wrap.is-fullscreen .volume-percentage {
    color: rgba(255,255,255,0.7);
}

/* ---- Fullscreen state (:fullscreen pseudo-class fallback) ---- */
.video-wrap:fullscreen {
    aspect-ratio: unset;
}

.video-wrap:fullscreen .controls-tray {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding-top: 32px;
}

.video-wrap:fullscreen .controls-tray.hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.video-wrap:fullscreen .podcast-controls {
    padding: 6px 28px 14px;
}

.video-wrap:fullscreen .seek-bar-wrap {
    padding: 0 28px;
}

.video-wrap:fullscreen .ctrl-btn {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

.video-wrap:fullscreen .ctrl-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.4);
}

.video-wrap:fullscreen .ctrl-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.video-wrap:fullscreen .ctrl-btn:hover img {
    opacity: 1;
}

.video-wrap:fullscreen .podcast-time {
    color: rgba(255,255,255,0.85);
}

.video-wrap:fullscreen .time-sep {
    opacity: 0.4;
}

.video-wrap:fullscreen .seek-bar {
    background: rgba(255,255,255,0.2);
}

.video-wrap:fullscreen .seek-bar-buffer {
    background: rgba(255,255,255,0.2);
}

.video-wrap:fullscreen .seek-bar-thumb {
    border-color: #fff;
}

/* WebKit fallback */
.video-wrap:-webkit-full-screen {
    aspect-ratio: unset;
}

.video-wrap:-webkit-full-screen .controls-tray {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding-top: 32px;
}

.video-wrap:-webkit-full-screen .controls-tray.hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.video-wrap:-webkit-full-screen .ctrl-btn {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

.video-wrap:-webkit-full-screen .ctrl-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.4);
}

.video-wrap:-webkit-full-screen .ctrl-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.video-wrap:-webkit-full-screen .podcast-time {
    color: rgba(255,255,255,0.85);
}

.video-wrap:-webkit-full-screen .seek-bar {
    background: rgba(255,255,255,0.2);
}

.video-wrap:-webkit-full-screen .seek-bar-buffer {
    background: rgba(255,255,255,0.2);
}

.video-wrap:-webkit-full-screen .seek-bar-thumb {
    border-color: #fff;
}

/* ---- Footer ---- */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 0 20px;
    color: var(--text-tertiary);
    font-size: 0.82em;
    font-weight: 500;
}

.footer-dot {
    width: 4px; height: 4px;
    background: var(--text-tertiary);
    border-radius: 50%;
    opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .container { padding: 20px 16px 40px; }
    header { margin-bottom: 32px; }
    .podcast-grid { grid-template-columns: 1fr; }
    .player-title { font-size: 1.15em; }
}

@media (max-width: 600px) {
    .pill-label { display: none; }
    .pill-btn { padding: 10px 14px; }
    .podcast-section { padding: 24px 20px; }
    .podcast-controls { padding: 10px 14px 6px; }
    .seek-bar-wrap { padding: 0 14px 12px; }
}
