.episode-watch-undo-wrap {
    margin: 0 0 1rem;
}


.episodes-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #1f7a76 0%, #2a948f 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.stat-card--accent {
    background: linear-gradient(135deg, #e3922b 0%, #c8761b 100%);
}

.stat-card--secondary {
    background: linear-gradient(135deg, #123f3a 0%, #1f5f57 100%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-caption {
    margin-top: 0.65rem;
    font-size: 0.82rem;
    opacity: 0.88;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: none;
}

.browse-discover-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(227, 146, 43, 0.08);
    border: 1px solid rgba(227, 146, 43, 0.28);
}

.browse-discover-strip__label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c8761b;
}

.browse-discover-strip__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.browse-discover-strip__link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(18, 63, 58, 0.22);
    background: rgba(255, 255, 255, 0.75);
    color: var(--brand-ink, #1a1a2e);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.browse-discover-strip__link:hover {
    background: #fff;
    border-color: rgba(31, 122, 118, 0.4);
    transform: translateY(-1px);
}

.browse-discover-strip__link:focus-visible {
    outline: 3px solid rgba(227, 146, 43, 0.35);
    outline-offset: 2px;
}

.browse-across-strip {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: rgba(31, 122, 118, 0.08);
    border: 1px solid rgba(31, 122, 118, 0.22);
    font-size: 0.92rem;
    color: var(--brand-ink, #1a1a2e);
}

.browse-across-strip__label {
    font-weight: 700;
    color: #1f7a76;
}

.browse-across-strip__stats {
    font-weight: 600;
}

.index-series-strip {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-soft, #e0e8e7);
    box-shadow: var(--shadow-soft, 0 4px 12px rgba(0, 0, 0, 0.06));
}

.index-series-strip__header {
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-ink, #1a1a2e);
    margin-bottom: 0.65rem;
}

.index-series-strip__row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.index-series-strip__progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.index-series-strip__bar-outer {
    flex: 1;
    height: 14px;
    background: #e8f4f3;
    border-radius: 7px;
    overflow: hidden;
}

.index-series-strip__bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #1f7a76, #2a948f);
    border-radius: 7px;
    transition: width 0.45s ease;
    min-width: 2px;
}

.index-series-strip__pct {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f7a76;
    min-width: 44px;
    text-align: right;
}

.index-series-strip__counts {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.controls-section {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-section,
.sort-section {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.browse-tools-section {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-select:hover {
    border-color: var(--brand-cool);
}

.control-select:focus {
    outline: none;
    border-color: var(--brand-cool);
    box-shadow: 0 0 0 3px rgba(31, 122, 118, 0.15);
}

.sort-controls {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.sort-controls .control-select {
    flex: 1;
}

.btn-sort-direction, .btn-add-episode {
    background: linear-gradient(135deg, #1f7a76 0%, #2a948f 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-sort-direction:hover, .btn-add-episode:hover {
    background: linear-gradient(135deg, #19645f 0%, #237e78 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 122, 118, 0.35);
}

.btn-sort-direction:active, .btn-add-episode:active {
    transform: translateY(0);
}

.btn-sort-direction .sort-icon {
    font-size: 1.1rem;
}

.btn-sort-direction .sort-text {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .episodes-container {
        padding: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .controls-section {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-section,
    .sort-section {
        min-width: 100%;
    }

    .sort-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

}

@media (max-width: 480px) {
    .btn-sort-direction .sort-text {
        display: none;
    }

    .stat-item {
        font-size: 0.9rem;
    }
}

/* Infinite Scroll Styles */
.load-more-trigger {
    height: 20px;
    margin: 2rem 0;
    opacity: 0;
    pointer-events: none;
}

.loading-indicator {
    gap: 1rem;
}

.end-message {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.end-message p {
    font-size: 1.2rem;
    color: #495057;
    margin: 0;
    font-weight: 600;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    margin: 2rem 0;
    background: var(--page-bg-alt);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-ink, #1a1a2e);
    margin-bottom: 0.75rem;
}

.empty-state-message {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
