/* CSS RELATIVO ALL'ARCHIVIO MODELLE */

.archive-modella-main {
    min-height: 80vh;
    background: #0f1015;
    color: #fff;
    padding-top: 100px; /* Spazio aumentato per la navbar fixed */
}

.container-hero {
    padding: 40px 0 40px;
    text-align: center;
}

.hero-badge.pink {
    background: rgba(var(--brand-secondary-rgb),0.12);
    color: var(--brand-secondary);
    border: 1px solid rgba(var(--brand-secondary-rgb),0.25);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
}

.hero-h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem) !important;
    font-weight: 900 !important;
    margin-bottom: 10px !important;
    letter-spacing: -1px;
}

.text-gradient-purple {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: #a0a0ab;
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 30px;
    line-height: 1.5;
}

/* BARRA DI RICERCA */
.search-bar-glass {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 8px 10px 8px 25px;
    max-width: 750px;
    margin: 0 auto 40px;
    transition: all 0.3s;
}

.search-bar-glass:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 30px rgba(var(--brand-primary-rgb), 0.2);
}

.search-input {
    background: transparent;
    border: none;
    color: #fff;
    flex: 1;
    outline: none;
    font-size: 1rem;
}

.search-submit-btn {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border: none;
    border-radius: 999px;
    padding: 0 25px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 950;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(var(--brand-secondary-rgb), 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-submit-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--brand-secondary-rgb), 0.5);
}

.search-submit-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.clear-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    margin: 0 10px;
    transition: 0.2s;
    flex-shrink: 0;
}

.clear-btn.is-active { display: flex; }
.clear-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* SELETTORI STATUS */
.status-pill-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.status-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a0a0ab;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pill.active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 25px rgba(var(--brand-primary-rgb), 0.3);
}

/* FILTRI AVANZATI (EXPANDABLE) */
.advanced-filters-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-trigger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 22px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.filter-trigger:hover, .filter-trigger.active {
    background: rgba(var(--brand-primary-rgb), 0.1);
    border-color: rgba(var(--brand-primary-rgb), 0.4);
    color: var(--brand-primary);
}

.filter-trigger.has-selection {
    background: rgba(var(--brand-secondary-rgb), 0.08);
    border-color: rgba(var(--brand-secondary-rgb), 0.5);
    color: #fff;
    box-shadow: 0 0 15px rgba(var(--brand-secondary-rgb), 0.15);
}

.filter-trigger.has-selection::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--brand-secondary);
    border-radius: 50%;
    margin-left: 5px;
}

.filter-panels-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.filter-panel {
    display: none;
    background: rgba(20, 20, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    z-index: 50;
    animation: slideUp 0.3s ease-out;
}

.panel-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 100;
}

.panel-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.filter-panel.active { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    display: block;
}

/* GRIGLIE FILTRI INTERNI */
.terms-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.term-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a0a0ab;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.term-item:hover, .term-item.selected {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* AGE PANEL SPECIFIC */
.age-panel-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
}

.age-column-left { border-right: 1px solid rgba(255,255,255,0.05); padding-right: 20px; }

@media (max-width: 768px) {
    .age-panel-grid { grid-template-columns: 1fr; gap: 20px; }
    .age-column-left { border-right: none; padding-right: 0; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 20px; }
}

/* RISULTATI */
.results-section { padding-bottom: 100px; }
.results-header { display: flex; justify-content: center; margin-bottom: 40px; }
.count-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 24px;
    border-radius: 999px;
    color: #a0a0ab;
    font-size: 0.88rem;
    font-weight: 600;
}
.count-pill strong { color: #fff; font-weight: 900; }

/* 4 colonne SPECIFICHE per il layout con sidebar (Ricerca) */
.directory-content .cards-grid {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Griglia generica (senza sidebar) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Default 5 colonne */
    gap: 25px;
}

@media (max-width: 1200px) { .cards-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 900px) { .cards-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 600px) { .cards-grid { grid-template-columns: repeat(1, 1fr) !important; gap: 15px !important; } }

/* LOADING OVERLAY */
.loading-overlay {
    display: none;
    text-align: center;
    padding: 60px 0;
    grid-column: 1 / -1;
    color: var(--brand-primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.loading-overlay.is-active { display: block; }

/* FIX PER HOMEPAGE AJAX */
.ajax-search-results.is-active {
    display: block !important;
}

#reset-filters-btn {
    display: none;
    margin: 20px auto 0;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 10px 25px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}
#reset-filters-btn.is-visible { display: flex; }

/* ══ LAYOUT DIRECTORY (BABESOURCE STYLE) ══════════════════════════ */
.directory-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 40px;
}

.directory-sidebar {
    width: 280px;
    position: sticky;
    top: 100px;
    flex-shrink: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 15px;
}

/* Scrollbar minimale per sidebar */
.directory-sidebar::-webkit-scrollbar { width: 4px; }
.directory-sidebar::-webkit-scrollbar-track { background: transparent; }
.directory-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.directory-sidebar::-webkit-scrollbar-thumb:hover { background: var(--brand-secondary); }

.directory-content {
    flex: 1;
    min-width: 0; /* Fix per grid in flexbox */
}

/* SIDEBAR GROUPS */
.sidebar-group {
    margin-bottom: 35px;
}

.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6b7280;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
}

.sidebar-title::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--brand-secondary);
    border-radius: 50%;
    margin-right: 10px;
}

/* SIDEBAR LISTS */
.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #a0a0ab;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.sidebar-link:hover {
    color: #fff;
    padding-left: 5px;
}

.sidebar-link.active {
    color: var(--brand-secondary);
    font-weight: 700;
}

.link-count {
    font-size: 0.75rem;
    color: #4b5563;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 35px;
    text-align: center;
}

.sidebar-link:hover .link-count {
    background: rgba(var(--brand-secondary-rgb), 0.1);
    color: var(--brand-secondary);
}

.archive-modella-main { padding-top: 100px; }

/* DIRECTORY TOOLBAR (UX/UI PREMIUM) */
.directory-toolbar {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.toolbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.directory-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
}

.count-badge {
    font-size: 0.8rem;
    background: rgba(var(--brand-secondary-rgb), 0.15);
    color: var(--brand-secondary);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid rgba(var(--brand-secondary-rgb), 0.2);
}

.toolbar-loader {
    display: none;
    opacity: 0.5;
}

.toolbar-loader.is-active {
    display: block;
}

.spinner-mini {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--brand-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toolbar-filters {
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ACTIVE FILTERS BAR (UI/UX PREMIUM) */
#active-filters-container {
    margin-bottom: 25px;
    display: none; /* Gestito via JS fadeIn */
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #fff;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-chip:hover {
    background: rgba(var(--brand-secondary-rgb), 0.1);
    border-color: var(--brand-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--brand-secondary-rgb), 0.2);
}

.remove-filter-chip {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-filter-chip:hover {
    color: var(--brand-secondary);
}

.clear-all-link {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 10px;
    transition: color 0.2s;
}

.clear-all-link:hover {
    color: #fff;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .directory-layout {
        flex-direction: column;
    }
    .directory-sidebar {
        width: 100%;
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 30px;
    }
    .sidebar-group {
        flex-shrink: 0;
        width: 200px;
        margin-bottom: 0;
    }
}
