/* assets/podcast-player.css */

/* Beausite Fit and Inter are expected to be provided by the host site.
   The plugin intentionally does not declare @font-face to avoid conflicts. */

@font-face {
    font-family: 'Beausite Fit';
    src: url('./fonts/beausite-fit-light.ttf') format('opentype');
    /*font-weight: 300;*/
    /*font-style: normal;*/
    /*font-display: swap;*/
}

/* ============================================
   Podcast Carousel Styles
   ============================================ */

.pc-carousel-container {
    width: 100%;
    overflow: hidden;
    padding: 0;
}

.pc-carousel-subtitle {
    display: flex;
    align-items: center;
    gap: 17px;
    margin-bottom: 20px;
    max-width: var(--pc-header-width, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--pc-header-padding, 0);
    padding-right: var(--pc-header-padding, 0);
}

.pc-carousel-subtitle span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: 12px;
    line-height: 150%;
    color: #000;
    vertical-align: middle;
}

.pc-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-left: var(--pc-header-padding, 0);
    padding-right: var(--pc-header-padding, 0);
    max-width: var(--pc-header-width, 100%);
    margin-left: auto;
    margin-right: auto;
}

.pc-carousel-title {
    font-family: 'Beausite Fit', sans-serif !important;
    font-weight: 300 !important;
    font-style: normal !important;
    font-size: 40px !important;
    line-height: 110% !important;
    letter-spacing: -0.02em !important;
    vertical-align: middle !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-carousel-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.pc-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
}

.pc-nav-btn svg {
    width: auto;
    height: 17.5px;
}

.pc-nav-btn:hover {
    opacity: 0.6;
}

.pc-nav-disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.pc-carousel-viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    cursor: pointer;
}

.pc-carousel-viewport::before,
.pc-carousel-viewport::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 2;
    pointer-events: none;
}

.pc-carousel-viewport::before {
    left: 0;
    background: linear-gradient(90deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
}

.pc-carousel-viewport::after {
    right: 0;
    background: linear-gradient(270deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
}

.pc-carousel-track {
    display: flex;
    gap: 32px;
    will-change: transform;
}

.pc-card {
    flex-shrink: 0;
    width: 364px;
    height: 364px;
    border-radius: 25px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
    cursor: pointer;
}

.pc-card-image {
    transition: transform 0.3s ease;
}

.pc-card:hover .pc-card-image {
    transform: scale(1.04);
}

.pc-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.pc-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Mobile nav (below carousel) — hidden on desktop */
.pc-carousel-nav-mobile {
    display: none;
}

/* Skeleton loading */
.pc-card-skeleton {
    cursor: default;
}

.pc-card-skeleton:hover {
    transform: none;
    box-shadow: none;
}

.pc-card-skeleton-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pc-shimmer 1.5s infinite;
    border-radius: 25px;
}

@keyframes pc-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Tablet Responsive ===== */
@media (max-width: 1024px) {
    .pc-carousel-subtitle,
    .pc-carousel-header {
        max-width: var(--pc-header-width-tablet, var(--pc-header-width, 100%));
    }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .pc-carousel-title {
        font-size: 24px !important;
    }

    .pc-carousel-subtitle,
    .pc-carousel-header {
        max-width: var(--pc-header-width-mobile, var(--pc-header-width-tablet, var(--pc-header-width, 100%)));
    }

    .pc-carousel-header {
        margin-bottom: 16px;
    }

    .pc-carousel-nav {
        display: none;
    }

    .pc-carousel-nav-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 24px;
        margin-top: 16px;
    }

    .pc-carousel-viewport::before,
    .pc-carousel-viewport::after {
        display: none;
    }

    .pc-carousel-track {
        /* gap set inline by JS on mobile */
    }

    .pc-carousel-viewport {
        overflow: hidden;
    }

    .pc-card {
        width: calc(100vw - 48px);
        height: calc(100vw - 48px);
        max-width: 364px;
        max-height: 364px;
    }

    .pc-card:hover .pc-card-image {
        transform: none;
    }
}

@media (max-width: 480px) {
    .pc-carousel-title {
        font-size: 24px;
    }

    .pc-card {
        width: calc(100vw - 48px);
        height: calc(100vw - 48px);
        max-width: 364px;
        max-height: 364px;
    }
}

/* ============================================
   Custom Video Player (CVP) Styles
   ============================================ */

.cvp-container {
    position: relative;
    user-select: none;
    overflow: hidden;
    background: #000;
}

.cvp-rounded {
    border-radius: 16px;
}

.cvp-aspect-video {
    aspect-ratio: 16 / 9;
}

/* Thumbnail / Poster */
.cvp-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cvp-placeholder {
    position: absolute;
    inset: 0;
    background: #1f2937;
}

.cvp-poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 40%, transparent 80%);
    pointer-events: none;
}

.cvp-poster-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.cvp-poster-center {
    justify-content: center;
    align-items: center;
}

.cvp-poster-bottom {
    justify-content: flex-end;
    align-items: flex-start;
}

/* Large play pill (centered) */
.cvp-play-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 20px 18px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
    .cvp-play-pill {
        padding: 28px 36px;
    }
}

.cvp-play-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.cvp-play-icon-lg {
    width: 12px;
    height: 12px;
}

@media (min-width: 640px) {
    .cvp-play-icon-lg {
        width: 25px;
        height: 26px;
    }
}

.cvp-play-pill-title {
    margin-left: 8px;
    font-weight: 400;
    font-size: 14px;
    line-height: 110%;
    letter-spacing: -0.02em;
    color: white;
    text-align: center;
    padding: 0 8px;
    margin: 0;
}

@media (min-width: 640px) {
    .cvp-play-pill-title {
        font-size: 16px;
        padding: 0 16px;
    }
}

/* Small play circle (bottom-left, 28px from left & bottom) */
.cvp-play-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 28px;
    bottom: 28px;
    width: 45px;
    height: 45px;
    background: #46AAB9;
    border-radius: 9999px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 2;
}

.cvp-play-circle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* Duration badge */
.cvp-duration-badge {
    position: absolute;
    align-self: flex-end;
    font-size: 14px;
    color: white;
    margin-top: 4px;
}

/* Loading spinner */
.cvp-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 10;
}

.cvp-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #5FC3D2;
    animation: cvp-spin 1s linear infinite;
}

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

/* Video area */
.cvp-video-area {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cvp-fill {
    width: 100%;
    height: 100%;
}

.cvp-fill iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Click overlay */
.cvp-click-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

/* Controls container */
.cvp-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    transition: opacity 0.3s, transform 0.3s;
}

.cvp-controls-visible {
    opacity: 1;
    transform: translateY(0);
}

.cvp-controls-hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.cvp-controls-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}

.cvp-controls-inner {
    position: relative;
    padding: 32px 16px 12px;
}

@media (min-width: 640px) {
    .cvp-controls-inner {
        padding: 40px 20px 16px;
    }
}

/* Progress bar */
.cvp-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: height 0.15s;
}

.cvp-progress-bar:hover {
    height: 10px;
}

.cvp-progress-hover {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
}

.cvp-progress-tooltip {
    position: absolute;
    top: -32px;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cvp-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #5FC3D2;
    border-radius: 9999px;
    transition: width 0.1s;
}

.cvp-progress-thumb {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(-50%) scale(0);
    transition: opacity 0.15s, transform 0.15s;
}

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

/* Controls row */
.cvp-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

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

/* Buttons */
.cvp-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: white;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cvp-btn:hover {
    color: #5FC3D2;
}

.cvp-btn-secondary {
    color: rgba(255, 255, 255, 0.7);
}

.cvp-btn-secondary:hover {
    color: white;
}

.cvp-icon-md {
    width: 24px;
    height: 24px;
}

.cvp-icon-sm {
    width: 20px;
    height: 20px;
}

/* Volume */
.cvp-volume-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cvp-volume-slider {
    overflow: hidden;
    transition: width 0.2s, opacity 0.2s;
}

.cvp-volume-open {
    width: 80px;
    opacity: 1;
}

.cvp-volume-closed {
    width: 0;
    opacity: 0;
}

.cvp-volume-track {
    position: relative;
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    cursor: pointer;
    transition: height 0.15s;
}

.cvp-volume-track:hover {
    height: 10px;
}

.cvp-volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #5FC3D2;
    border-radius: 9999px;
}

.cvp-volume-thumb {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(-50%) scale(0);
    transition: opacity 0.15s, transform 0.15s;
}

.cvp-volume-track:hover .cvp-volume-thumb {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Time display */
.cvp-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    margin-left: 4px;
}

@media (min-width: 640px) {
    .cvp-time {
        font-size: 14px;
    }
}

.cvp-time-sep {
    color: rgba(255, 255, 255, 0.4);
}

/* Paused center icon */
.cvp-paused-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
}

.cvp-paused-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cvp-fadeIn 0.15s ease-out;
}

@media (min-width: 640px) {
    .cvp-paused-circle {
        width: 80px;
        height: 80px;
    }
}

.cvp-paused-svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
}

@media (min-width: 640px) {
    .cvp-paused-svg {
        width: 40px;
        height: 40px;
    }
}

@keyframes cvp-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hide on mobile */
.cvp-hide-mobile {
    display: none;
}

@media (min-width: 640px) {
    .cvp-hide-mobile {
        display: flex;
    }
}
