/* ==========================================================================
   Advanced Story Filter & Discovery Stylesheet - Nhalavn Theme
   Aesthetics: Vietnamese Youth & Zen Aesthetic (Jade Green, Warm Paper, Slate Dark)
   ========================================================================== */

.td-filter-page-wrap {
    min-height: 70vh;
}

/* ── Hero Badge & Header ── */
.td-filter-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 9999px;
    background: rgba(5, 150, 105, 0.1);
    color: var(--td-primary, #059669);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid rgba(5, 150, 105, 0.2);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.06);
}

.series-search-container {
    max-width: 920px;
    margin: 0 auto 3rem auto;
}

/* ── Search Input ── */
.series-search-container .search-input-wrapper {
    position: relative;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

.series-search-container .search-input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.series-search-container .search-input-wrapper input {
    background-color: var(--td-card-bg, #ffffff);
    border: 1px solid var(--vn-border-soft, #e2e8f0);
    color: var(--td-text-color, #1e293b);
    padding: 14px 20px 14px 48px;
    border-radius: 50rem;
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
    transition: all 0.25s ease;
}

.series-search-container .search-input-wrapper input:focus {
    border-color: var(--td-primary, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
    background-color: #ffffff;
}

.series-search-container .search-input-wrapper:focus-within .search-input-icon {
    color: var(--td-primary, #059669);
}

/* ── Select Dropdowns ── */
.series-search-container select.form-select {
    background-color: var(--td-card-bg, #ffffff);
    border: 1px solid var(--vn-border-soft, #e2e8f0);
    color: #334155;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.series-search-container select.form-select:hover {
    border-color: #cbd5e1;
}

.series-search-container select.form-select:focus {
    border-color: var(--td-primary, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

/* ── Filter Badges ── */
.td-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--td-primary, #059669);
    border: 1px solid rgba(5, 150, 105, 0.22);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.td-filter-badge .remove-badge {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.td-filter-badge .remove-badge:hover {
    opacity: 1;
    color: #ef4444;
}

.td-filter-clear-btn {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 9999px;
    background-color: #334155;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.td-filter-clear-btn:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
}

/* ── Series 7-Column Responsive Grid ── */
.series-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 2.5rem;
}

@media (min-width: 480px) {
    .series-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .series-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

@media (min-width: 992px) {
    .series-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1200px) {
    .series-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1400px) {
    .series-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 22px;
    }
}

/* ── Story Card ── */
.series-card {
    min-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.series-card-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    border-radius: 12px;
    background-color: #e2e8f0;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.series-card:hover .series-card-cover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -4px rgba(5, 150, 105, 0.2);
}

.series-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.series-card:hover .series-card-cover img {
    transform: scale(1.05);
}

/* Badges on Covers */
.series-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.series-card-badge.badge-full {
    background: rgba(5, 150, 105, 0.85);
    border-color: rgba(52, 211, 153, 0.4);
}

.series-card-badge.badge-short {
    background: rgba(2, 132, 199, 0.85);
    border-color: rgba(56, 189, 248, 0.4);
}

/* Card Title & Meta */
.series-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 10px;
    margin-bottom: 2px;
    color: var(--td-text-color, #1e293b);
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.series-card:hover .series-card-title {
    color: var(--td-primary, #059669);
}

.series-card-genres {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ── Empty State ── */
.td-filter-empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--td-card-bg, #ffffff);
    border: 1px dashed var(--vn-border-soft, #e2e8f0);
    border-radius: 20px;
    max-width: 500px;
    margin: 2rem auto;
}

.td-filter-empty-state .empty-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.1);
    color: var(--td-primary, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

/* ── Results Container Transition ── */
.td-filter-results-wrap {
    transition: opacity 0.25s ease-in-out;
}

/* ── Dark Mode Overrides ── */
.dark-mode .td-filter-hero-badge,
[data-bs-theme="dark"] .td-filter-hero-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.25);
}

.dark-mode .series-search-container .search-input-wrapper input,
[data-bs-theme="dark"] .series-search-container .search-input-wrapper input {
    background-color: var(--td-card-bg, #161c26);
    border-color: var(--td-border-color, #232c3d);
    color: #f1f5f9;
}

.dark-mode .series-search-container .search-input-wrapper input:focus,
[data-bs-theme="dark"] .series-search-container .search-input-wrapper input:focus {
    background-color: #1a2230;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.dark-mode .series-search-container select.form-select,
[data-bs-theme="dark"] .series-search-container select.form-select {
    background-color: var(--td-card-bg, #161c26);
    border-color: var(--td-border-color, #232c3d);
    color: #cbd5e1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

.dark-mode .series-search-container select.form-select:hover,
[data-bs-theme="dark"] .series-search-container select.form-select:hover {
    border-color: #334155;
}

.dark-mode .series-search-container select.form-select:focus,
[data-bs-theme="dark"] .series-search-container select.form-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.dark-mode .td-filter-badge,
[data-bs-theme="dark"] .td-filter-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
}

.dark-mode .td-filter-clear-btn,
[data-bs-theme="dark"] .td-filter-clear-btn {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.dark-mode .td-filter-clear-btn:hover,
[data-bs-theme="dark"] .td-filter-clear-btn:hover {
    background-color: #334155;
}

.dark-mode .series-card-cover,
[data-bs-theme="dark"] .series-card-cover {
    background-color: #1e293b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.dark-mode .series-card:hover .series-card-cover,
[data-bs-theme="dark"] .series-card:hover .series-card-cover {
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.25);
}

.dark-mode .series-card-title,
[data-bs-theme="dark"] .series-card-title {
    color: #f1f5f9;
}

.dark-mode .series-card:hover .series-card-title,
[data-bs-theme="dark"] .series-card:hover .series-card-title {
    color: #34d399;
}

.dark-mode .series-card-genres,
[data-bs-theme="dark"] .series-card-genres {
    color: #94a3b8;
}

.dark-mode .td-filter-empty-state,
[data-bs-theme="dark"] .td-filter-empty-state {
    background: var(--td-card-bg, #161c26);
    border-color: var(--td-border-color, #232c3d);
}

.dark-mode .td-filter-empty-state .empty-icon-wrap,
[data-bs-theme="dark"] .td-filter-empty-state .empty-icon-wrap {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
