﻿/* ==========================================================================
   Videos (Slate Developer Theme)
   ========================================================================== */

.video-container {
    max-width: 1200px;
    margin: 15px auto;
    padding: 20px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* ---------- Video/Audio Cards Grid ----------
   Fluid columns: the count per row shrinks automatically as the screen
   narrows so cards never get squeezed or cut off at the edge. */
.page-container:has(> .video-files) {
    max-width: 1200px;
}

.video-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
    gap: 18px;
    width: 100%;
    max-width: 100%;
    margin: 15px auto;
    padding: 5px;
    box-sizing: border-box;
}

.video-files > * {
    min-width: 0;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: var(--bg-surface-hover);
}

.audio-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2.2rem;
    background: linear-gradient(135deg, rgba(147, 26, 35, 0.15) 0%, var(--bg-surface-hover) 100%);
}

.video-info {
    padding: 14px;
    padding-right: 56px;
}

.video-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    min-width: 0;
}

/* ---------- Badges ---------- */
.badge-vid {
    background: rgba(147, 26, 35, 0.15);
    color: var(--primary);
    border: 1px solid rgba(147, 26, 35, 0.3);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Fira Code', monospace;
}

.badge-aud {
    background: rgba(34, 197, 94, 0.15);
    color: var(--correct);
    border: 1px solid rgba(34, 197, 94, 0.3);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Fira Code', monospace;
}

.video-sub {
    color: var(--text-secondary);
    font-size: 11px;
    font-family: 'Fira Code', monospace;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Lecturer picker dialog rows ---------- */
.lec-pick {
    margin-bottom: 8px;
}

.lec-pick .subject-check-name {
    font-size: 14px;
}

.lec-tag {
    font-size: 0.62rem;
    padding: 1px 7px;
    white-space: nowrap;
}

.subject-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    flex: 0 0 auto;
}

/* ---------- Merged YouTube sources ---------- */
.badge-yt {
    background: rgba(255, 0, 0, 0.12);
    color: #ff4d4d;
    border: 1px solid rgba(255, 0, 0, 0.35);
    font-size: 0.62rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-yt i {
    font-size: 0.7rem;
}

.video-container .lec-chip.yt-chip {
    color: #ff6b6b;
    border-color: rgba(255, 0, 0, 0.35);
    background: rgba(255, 0, 0, 0.08);
    font-weight: 600;
}

.yt-only-card {
    border-color: rgba(255, 0, 0, 0.25);
}

.subject-check-card.yt-pick {
    border-color: rgba(255, 0, 0, 0.3);
    background: rgba(255, 0, 0, 0.04);
}

.subject-check-card.yt-pick:hover {
    border-color: #ff0000;
}

.yt-pick-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 0, 0, 0.35);
    background: var(--bg-surface-hover);
}

/* ---------- Horizontal chips strip, manual scroll only ----------
   Lecturer / YouTube names sit on ONE horizontal line (never wrapped).
   The strip scrolls horizontally by hand (swipe / shift+wheel / touchpad);
   no auto-scroll — scrollbars stay hidden on all browsers. */
.video-container .dev-card-desc.mat-sub {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
    min-height: 1.9em;
    max-height: 1.9em;
    line-height: 1.7;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.video-container .dev-card-desc.mat-sub::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.video-container .mat-sub .chips-marquee {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: none;
}

.video-container .mat-sub .chips-marquee .lec-chip {
    flex: 0 0 auto;
}

.video-container .dev-card.mat-card:hover .dev-card-desc.mat-sub {
    cursor: ew-resize;
}

/* ---------- Download Button (bottom-right of card) ---------- */
.video-dl {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.video-dl:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---------- Cache Status Pills (top-right over thumb) ---------- */
.video-cache-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    z-index: 2;
}

.video-cache-badge.cached {
    background: rgba(34, 197, 94, 0.15);
    color: var(--correct);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.video-cache-badge.partial {
    background: rgba(249, 115, 22, 0.15);
    color: var(--timer-color);
    border: 1px solid rgba(249, 115, 22, 0.3);
}