/**
 * YouTube Video Carousel - Frontend Styles
 */

:root {
    --ytc-primary: #ff0000;
    --ytc-accent: #0284c7;
    --ytc-dark: #0f172a;
    --ytc-text-muted: #64748b;
    --ytc-card-bg: #ffffff;
    --ytc-card-radius: 12px;
    --ytc-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --ytc-shadow-md: 0 12px 28px rgba(0, 0, 0, 0.09);
    --ytc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   1. CAROUSEL CONTAINER & SWIPER
   ========================================== */
.ytc-carousel-container {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    margin: 20px 0;
}

.ytc-swiper {
    width: 100%;
    padding: 10px 4px 45px 4px !important;
    overflow: hidden;
    position: relative;
}

.ytc-slide {
    height: auto !important;
    display: flex;
    box-sizing: border-box;
}

/* ==========================================
   2. VIDEO CARD DESIGN
   ========================================== */
.ytc-video-card {
    width: 100%;
    background: var(--ytc-card-bg);
    border-radius: var(--ytc-card-radius);
    border: 1px solid #eef2f6;
    box-shadow: var(--ytc-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--ytc-transition);
    position: relative;
}

.ytc-video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ytc-shadow-md);
    border-color: #cbd5e1;
}

/* Media & Thumbnail Box */
.ytc-card-media {
    position: relative;
    width: 100%;
    background: #000000;
    overflow: hidden;
}

.ytc-ratio-16-9 {
    padding-top: 56.25%; /* 16:9 */
}

.ytc-ratio-4-3 {
    padding-top: 75%; /* 4:3 */
}

.ytc-ratio-1-1 {
    padding-top: 100%; /* 1:1 */
}

.ytc-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.ytc-video-card:hover .ytc-thumb-img {
    transform: scale(1.06);
    opacity: 0.95;
}

/* Authentic YouTube Play Button Overlay */
.ytc-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: var(--ytc-transition);
}

.ytc-video-card:hover .ytc-play-overlay {
    background: rgba(0, 0, 0, 0.15);
}

.ytc-play-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    outline: none !important;
    box-shadow: none !important;
}

.ytc-youtube-play-btn {
    width: 68px;
    height: 48px;
    display: block;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: transform 0.2s ease;
}

.ytc-youtube-play-btn svg {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    display: block;
}

.ytc-youtube-play-btn .ytc-yt-btn-bg {
    fill: #212121;
    fill-opacity: 0.85;
}

.ytc-video-card:hover .ytc-youtube-play-btn {
    transform: scale(1.08);
}

/* Inline iframe container */
.ytc-inline-iframe-wrap {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #000;
}

.ytc-inline-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.ytc-video-card.ytc-playing-inline .ytc-inline-iframe-wrap {
    display: block;
}

/* Card Content */
.ytc-card-content {
    padding: 16px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #ffffff;
}

.ytc-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ytc-dark);
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.ytc-card-title a {
    color: inherit;
    text-decoration: none;
}

.ytc-video-card:hover .ytc-card-title,
.ytc-card-title a:hover {
    color: var(--ytc-accent);
}

.ytc-card-meta {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ytc-text-muted);
}

.ytc-channel-name {
    font-weight: 600;
    color: #475569;
}

.ytc-date {
    color: #94a3b8;
}

/* ==========================================
   3. SWIPER NAVIGATION & PAGINATION
   ========================================== */
.ytc-nav-btn {
    position: absolute;
    top: 30%; /* Centered vertically over the video thumbnail media */
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 15;
    padding: 0;
    transition: var(--ytc-transition);
    outline: none;
}

.ytc-nav-btn::after {
    display: none !important; /* Hide default Swiper text arrows */
}

.ytc-nav-btn svg {
    stroke: currentColor;
    display: block;
    transition: transform 0.2s ease;
}

.ytc-nav-btn:hover {
    background: var(--ytc-accent);
    color: #ffffff;
    border-color: var(--ytc-accent);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.25);
}

.ytc-nav-prev {
    left: -18px;
}

.ytc-nav-next {
    right: -18px;
}

.ytc-nav-btn.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .ytc-nav-prev { left: 4px; }
    .ytc-nav-next { right: 4px; }
}

/* Pagination Bullets */
.ytc-pagination {
    bottom: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ytc-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    opacity: 1;
    border-radius: 4px;
    transition: var(--ytc-transition);
    margin: 0 !important;
}

.ytc-pagination .swiper-pagination-bullet-active {
    width: 24px;
    background: var(--ytc-accent);
    border-radius: 10px;
}

/* ==========================================
   4. LIGHTBOX POPUP MODAL PLAYER
   ========================================== */
.ytc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-sizing: border-box;
}

.ytc-modal.ytc-modal-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ytc-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ytc-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 10;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ytc-modal.ytc-modal-active .ytc-modal-content {
    transform: scale(1);
}

.ytc-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ytc-transition);
}

.ytc-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.ytc-modal-video-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ytc-modal-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
