/* Header Card Size Control - Visible when filters are collapsed */

/* Header card size container styling */
.header-card-size {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
    transition: opacity 0.3s ease;
}

/* Show only in grid view when filters are collapsed */
.search-filters.has-collapsed-content .header-card-size {
    /* Controlled by JavaScript based on view mode */
}

.header-card-size label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Compact control styling for header */
.header-card-size .card-size-control.compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--dark-surface-2, rgba(255, 255, 255, 0.05));
    border-radius: 4px;
    border: 1px solid var(--dark-surface-3, rgba(255, 255, 255, 0.1));
}

.header-card-size .card-size-slider {
    width: 80px;
    height: 3px;
    background: var(--border-light, rgba(255, 255, 255, 0.15));
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    border-radius: 2px;
    transition: background 0.2s;
}

.header-card-size .card-size-slider:hover {
    background: var(--border, rgba(255, 255, 255, 0.25));
}

.header-card-size .card-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.header-card-size .card-size-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.header-card-size .card-size-slider::-webkit-slider-thumb:hover {
    background: var(--accent, #3498db);
    transform: scale(1.2);
}

.header-card-size .card-size-slider::-moz-range-thumb:hover {
    background: var(--accent, #3498db);
    transform: scale(1.2);
}

.header-card-size .card-size-icon {
    width: 14px;
    height: 14px;
    fill: var(--text-secondary);
    opacity: 0.7;
    flex-shrink: 0;
}

.header-card-size .card-size-icon.small {
    width: 12px;
    height: 12px;
}

.header-card-size .card-size-icon.large {
    width: 16px;
    height: 16px;
}

.header-card-size .card-size-value {
    font-size: 10px;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: center;
    font-weight: 600;
}

/* Instance mode specific adjustments */
.app-instance .header-card-size {
    flex: 0 0 auto;
}

.app-instance .search-filters-header {
    flex-wrap: nowrap;
    min-height: 40px;
}

/* Ensure proper spacing in header when card size is visible */
.app-instance .search-filters.has-collapsed-content .search-filters-header {
    gap: 8px;
}

.app-instance .search-filters-header-left {
    flex: 0 1 auto;
    min-width: 0;
}

.app-instance .timeline-mode-selector {
    flex: 0 0 auto;
}

/* Hide main card size container when filters are collapsed */
.app-instance .filter-content.collapsed .card-size-container {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .header-card-size .card-size-slider {
        width: 60px;
    }
    
    .header-card-size label {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Hide header card size on mobile to save space */
    .header-card-size {
        display: none !important;
    }
}

/* Animation for smooth transitions */
.header-card-size {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure sync between header and main sliders */
.instance-card-size-slider-header,
.instance-card-size-slider {
    /* Ensure both sliders have the same range and behavior */
    min: 0.5;
    max: 2;
    step: 0.1;
}