/* ==========================================================================
   HISTORY PAGE SPECIFIC STYLES
   ========================================================================== */

/* --- HEADER & FILTER TABS --- */
.header {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 16px 0 16px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.clear-btn {
    background: transparent;
    color: #ff5252;
    border: 1px solid #ff5252;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.clear-btn:hover {
    background: rgba(255, 82, 82, 0.1);
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: var(--background-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
}

/* --- MAIN CONTAINER & GROUPED SECTIONS --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px 24px 16px;
}

.history-section {
    margin-bottom: 28px;
}

.section-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

/* Arrow controls matching style-home.css */
.scroll-arrows {
    display: flex;
    gap: 8px;
}

.arrow-btn {
    background: var(--background-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.arrow-btn:hover {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
}

/* --- HORIZONTAL SWIPE / SCROLL ROW --- */
.media-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--background-tertiary) transparent;
}

.media-row::-webkit-scrollbar {
    height: 6px;
}

.media-row::-webkit-scrollbar-thumb {
    background: var(--background-tertiary);
    border-radius: 4px;
}

/* --- MEDIA CARDS & OVERLAYS --- */
.media-card {
    flex: 0 0 140px;
    width: 140px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.media-card:hover {
    transform: translateY(-4px);
}

.poster-box {
    position: relative;
    width: 100%;
    height: 210px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--background-secondary);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.media-card:hover .poster-box {
    border-color: var(--accent-primary);
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay badges */
.rating-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(10, 12, 15, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

.delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(10, 12, 15, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 3;
}

.delete-btn:hover {
    color: #ff5252;
    background: rgba(255, 82, 82, 0.2);
    border-color: #ff5252;
}

.delete-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.episode-pill {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(10, 12, 15, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 2;
}

.card-type {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- ACTIVE NAVIGATION PILL --- */
.nav-item.active-pill {
    background: var(--background-tertiary);
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

/* --- RESPONSIVE DESKTOP ADJUSTMENTS --- */
@media (min-width: 850px) {
    .media-card {
        flex: 0 0 150px;
        width: 150px;
    }

    .poster-box {
        height: 225px;
    }
}

