/*
  ChapsContainedVideoComponent.css
  Index
  • Config / Custom Properties
  • Base & Layout
  • Header (Title + Subtitle)
  • Video Player (cvp-*)
  • Responsive
*/

/* ─── Config / Custom Properties ─────────────────────────────────────── */
chaps-contained-video-component,
.chaps-contained-video-component {
    display: block;

    --ccvc-title-color:    #18211E;
    --ccvc-subtitle-color: #5D7374;
    --ccvc-section-bg:     #ffffff;

    background-color: var(--ccvc-section-bg);
}

/* ─── Base & Layout ───────────────────────────────────────────────────── */
.ccvc-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ─── Header ─────────────────────────────────────────────────────────── */
.ccvc-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ccvc-title {
    color: var(--ccvc-title-color);
    margin: 0 0 0.75rem;
}

.ccvc-subtitle {
    color: var(--ccvc-subtitle-color);
    margin: 0 auto;
    max-width: 680px;
    line-height: 1.65;
}

/* ─── Video Player (ported from standalone) ───────────────────────────── */
.cvp-contained-video-block {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #5d7374;
    border-radius: 8px;
    border: 1px solid #A9C1B8;
    overflow: hidden;
    margin: 0 auto 40px;
}

.cvp-boxed-video-wrapper {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%;
    pointer-events: none;
}
.cvp-boxed-video-wrapper iframe {
    width: 100%;
    height: 100%;
}

/* Poster Slate */
.cvp-video-poster-slate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cvp-poster-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.65) contrast(1.05);
    transition: transform 0.6s ease, opacity 0.4s ease;
    z-index: 1;
}
.cvp-video-poster-slate:hover .cvp-poster-image {
    transform: scale(1.02);
}

/* Central Play Button */
.cvp-central-play-btn {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(95, 115, 116, 0.85);
    border: 1px solid #DCEFE3;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cvp-central-play-btn:hover {
    background: #5d7374;
    border-color: #DCEFE3;
    color: #DCEFE3;
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(95, 115, 116, 0.35);
}

.cvp-contained-video-block:not(:hover) .cvp-central-play-btn.video-initialized {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}
.cvp-central-play-btn.video-initialized {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cvp-play-pulse-ring {
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid rgba(95, 115, 116, 0.4);
    pointer-events: none;
    animation: corePulse 2.5s infinite;
}
@keyframes corePulse {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Meta Pill */
.cvp-boxed-meta-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 7;
}
.cvp-boxed-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(68, 85, 86, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid #DCEFE3;
    padding: 6px 14px;
    border-radius: 4px;
}
.cvp-boxed-meta-pill span {
    font-size: 11px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.pulse-dot-emerald {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* Timeline */
.cvp-youtube-timeline-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12px;
    z-index: 7;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
#cvpTimelineSlider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #DCEFE3 0%, rgba(255, 255, 255, 0.1) 0%);
    outline: none;
    cursor: pointer;
    margin: 0;
    transition: height 0.15s ease-in-out;
}
.cvp-contained-video-block:hover #cvpTimelineSlider {
    height: 6px;
}
#cvpTimelineSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #DCEFE3;
    box-shadow: 0 0 8px rgba(169, 193, 184, 0.8);
    transform: scale(0);
    transition: transform 0.15s ease-in-out;
}
.cvp-contained-video-block:hover #cvpTimelineSlider::-webkit-slider-thumb {
    transform: scale(1);
}

/* Control Pod */
.cvp-video-control-pod {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 7;
    display: flex;
    align-items: center;
    background: rgba(68, 85, 86, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid #DCEFE3;
    padding: 4px;
    border-radius: 6px;
    gap: 4px;
    transition: opacity 0.3s ease;
}
.cvp-control-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.cvp-control-btn:hover {
    color: #DCEFE3;
    background: rgba(255, 255, 255, 0.03);
}
.cvp-pod-divider {
    width: 1px;
    height: 14px;
    background: #2D393A;
    margin: 0 2px;
}

/* Volume Slider */
.cvp-volume-container {
    display: flex;
    align-items: center;
}
.cvp-volume-slider-wrapper {
    width: 0px;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}
.cvp-volume-container:hover .cvp-volume-slider-wrapper {
    width: 70px;
    margin-left: 4px;
    margin-right: 4px;
}
#cvpVolumeSlider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #DCEFE3 50%, #1e293b 50%);
    outline: none;
    cursor: pointer;
}
#cvpVolumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00a3e0;
}

/* Tooltip */
.cvp-toast-tooltip {
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1e293b;
    color: #f8fafc;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
}
.cvp-toast-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .ccvc-inner {
        padding: 0 1rem;
    }
    .ccvc-header {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 639px) {
    .ccvc-title {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }
    .cvp-boxed-meta-pill {
        display: none; /* hide pill on very small screens to avoid overlap */
    }
    .cvp-control-btn {
        width: 20px;
        height: 20px;
    }
}