/* ============================================================
   FotoDigital Photobook - Filters Panel
   ============================================================ */

/* ── Griglia filtri ── */
.mc-filters-grid,
#filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── Singolo filtro ── */
.mc-filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: var(--mc-radius, 6px);
    padding: 6px;
    transition: background 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    background: #fff;
}

.mc-filter-item:hover {
    background: var(--mc-primary-light, #BBDEFB);
    border-color: var(--mc-primary, #2196F3);
}

/* ── Filtro attivo ── */
.mc-filter-item.active {
    border-color: var(--mc-primary, #2196F3);
    background: var(--mc-primary-light, #BBDEFB);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.25);
}

.mc-filter-item.active .mc-filter-label {
    color: var(--mc-primary-dark, #1976D2);
    font-weight: 600;
}

/* ── Preview thumbnail ── */
.mc-filter-preview {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
}

.mc-filter-preview img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* ── Label sotto preview ── */
.mc-filter-label {
    margin-top: 5px;
    font-size: 11px;
    color: var(--mc-text, #263238);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 76px;
}

/* ── Scrollbar personalizzata ── */
.mc-filters-grid::-webkit-scrollbar,
#filters-grid::-webkit-scrollbar {
    width: 5px;
}

.mc-filters-grid::-webkit-scrollbar-track,
#filters-grid::-webkit-scrollbar-track {
    background: transparent;
}

.mc-filters-grid::-webkit-scrollbar-thumb,
#filters-grid::-webkit-scrollbar-thumb {
    background: var(--mc-text-light, #78909C);
    border-radius: 3px;
}

/* ── Placeholder caricamento ── */
.mc-filter-preview img[src*="data:image/gif"] {
    opacity: 0.4;
    animation: mc-filter-pulse 1.2s ease-in-out infinite;
}

@keyframes mc-filter-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ── Regolazioni manuali (slider) ── */
.mc-filter-adjustments {
    padding: 12px;
    border-top: 1px solid var(--mc-border, #e0e0e0);
    margin-top: 4px;
}
.mc-filter-adjustments .mc-panel-subtitle {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text, #263238);
}
.mc-adj-row {
    margin-bottom: 12px;
}
.mc-adj-row label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--mc-text, #263238);
    margin-bottom: 4px;
    font-weight: 500;
}
.mc-adj-value {
    color: var(--mc-text-light, #78909C);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    min-width: 32px;
    text-align: right;
}
.mc-adj-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
.mc-adj-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(to right, #ddd 0%, #ddd 50%, #ddd 100%);
    border-radius: 2px;
}
.mc-adj-slider::-moz-range-track {
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}
.mc-adj-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--mc-primary, #e84b4b);
    margin-top: -5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.mc-adj-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--mc-primary, #e84b4b);
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.mc-filter-adjustments[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}
