/* Layout Controls - Dynamic card sizing and layout modes */

:root {
    --card-min-width: 280px;
}

/* Control UI */
.layout-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#card-size-slider {
    width: 120px;
    cursor: pointer;
    accent-color: #e74c3c;
}

#card-size-label {
    min-width: 55px;
    font-size: 12px;
    color: #7f8c8d;
}

.layout-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s;
}

.layout-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.layout-btn.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* Dynamic grid - uses CSS variable for card min-width */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width, 280px), 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Full-width mode - removes container max-width */
body.layout-fullwidth .container,
body.layout-fullwidth .top10-container {
    max-width: none;
    padding-left: 20px;
    padding-right: 20px;
}

/* Override top10.css fixed breakpoints when controls are active */
body.layout-controls-active .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width, 280px), 1fr)) !important;
}

/* Mobile: hide controls, force single column */
@media (max-width: 768px) {
    .layout-controls {
        display: none !important;
    }

    .filter-group:has(.layout-btn) {
        display: none !important;
    }

    .results-grid {
        grid-template-columns: 1fr !important;
    }
}
