/* ==========================================================================
   🎬 WATCH HISTORY SHELF LAYET (Matching Sidebar Theme)
   ========================================================================== */

/* 1. Main container wrapping the row */
.watch-history-panel {
    background: #141414; /* Matches dark panel aesthetic */
    padding: 20px 0;
    width: 100%;
    margin: 20px auto;
}

/* 2. Section Title Header */
.watch-history-title {
    color: #aaaaaa;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 14px 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    user-select: none;
}

/* 3. Horizontal Slider Track */
.watch-history-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 16px 12px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth mobile swipe */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.watch-history-track::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* 4. Individual Watch History Card (Mirroring .episode layout behavior) */
.history-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 150px; /* Locked width constraint on desktop */
    width: 150px;
    max-width: 150px;
    transition: background 0.2s, opacity 0.2s;
}

/* 5. Thumbnail Wrapper (Mirroring .thumb aspect constraints) */
.history-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 84px; /* Perfect 16:9 ratio box based on 150px width */
    min-height: 84px;
    max-height: 84px;
    background: #222; /* Matches .thumb background */
    border-radius: 4px; /* Matches sidebar border-radius */
    border: 1px solid #2c2c2c; /* Matches sidebar border color */
    overflow: hidden;
    flex-shrink: 0;
}

/* Hover effect synced to your card choice */
.history-card:hover .history-thumb-wrapper {
    background: #1e1e1e;
    border-color: #1db954; /* Optional subtle transition to green border */
    cursor: pointer;
}

.history-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* 6. Dynamic Progress Bar (Unique to history items) */
.history-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
}

.history-progress-fill {
    height: 100%;
    background: #1db954; /* Using the beautiful Spotify green from .episode.playing */
    width: 0;
    transition: width 0.3s ease;
}

/* 7. Card Meta Information Block (Mirroring .ep-info) */
.history-info {
    display: flex;
    flex-direction: column;
    margin-top: 8px; /* Stacked under instead of beside */
    min-width: 0; /* Flex fix for clean marquee limits */
    overflow: hidden;
    white-space: nowrap;
}

.history-video-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.history-video-sub {
    color: #b3b3b3;
    font-size: 11px;
    margin-top: 2px;
}

/* ==========================================================================
   📱 RESPONSIVE MEDIA BREAKPOINTS (Your Target Edge Cases)
   ========================================================================== */

/* Tablet View Edge Case (Width < 800px) */
@media screen and (max-width: 800px) {
    .watch-history-track {
        gap: 12px;
    }
    .history-card {
        flex: 0 0 130px;
        width: 130px;
        max-width: 130px;
    }
    .history-thumb-wrapper {
        height: 73px; /* Dynamic 16:9 box scale for tablet */
        min-height: 73px;
        max-height: 73px;
    }
    .history-video-title { font-size: 11px; }
    .history-video-sub { font-size: 10px; }
}

/* Mobile View Edge Case (Width < 400px) */
@media screen and (max-width: 400px) {
    .watch-history-track {
        gap: 10px;
    }
    .history-card {
        flex: 0 0 110px;
        width: 110px;
        max-width: 110px;
    }
    .history-thumb-wrapper {
        height: 62px; /* Dynamic 16:9 box scale for small mobile profiles */
        min-height: 62px;
        max-height: 62px;
    }
}