/* Mobile responsive fixes for Sort & View */
@media (max-width: 768px) {
    .control-group .filter-controls {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .control-group .filter-group {
        width: 100% !important;
    }
    
    .control-group .filter-group select {
        width: 100% !important;
        min-height: 44px !important;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .control-group .filter-controls {
        gap: 0.75rem !important;
    }
    
    .control-group .filter-group select {
        font-size: 0.85rem !important;
        padding: 0.65rem !important;
        padding-right: 2.25rem !important;
    }
}

/* Large desktop - ensure proper spacing */
@media (min-width: 1025px) {
    .control-group .filter-controls {
        gap: 1.25rem !important;
    }
    
    .control-group .filter-group select {
        padding: 0.8rem !important;
        padding-right: 2.75rem !important;
    }
}/* Enhanced ignore controls with two checkboxes */
.ignore-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (min-width: 769px) {
    .ignore-controls {
        flex-direction: row;
        gap: 2rem;
        align-items: center;
        justify-content: flex-start;
    }
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: calc(0.9rem * var(--mobile-font-scale, 1));
    color: var(--text-secondary, rgba(255, 255, 255, 0.9));
    font-weight: 500;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--text-primary, #ffffff);
}

.ignore-checkbox {
    margin-right: 0.75rem;
    width: 20px;
    height: 20px;
    accent-color: var(--retro-blue, #667eea);
    cursor: pointer;
}

.ignore-checkbox:checked + .checkmark + span {
    color: var(--text-primary, #ffffff);
    font-weight: 600;
}/* EMERGENCY FIX FOR BUTTON POSITIONING */
/* This file overrides all other styles to fix the terrible positioning */

/* Force the filter-controls to be a proper 2-column grid with proper containment */
.control-group .filter-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    align-items: end !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Ensure filter groups don't overflow */
.control-group .filter-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Fix select dropdown sizing */
.control-group .filter-group select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0.75rem !important;
    font-size: 0.9rem !important;
    height: 44px !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-radius: 8px !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

/* Fix labels */
.control-group .filter-group label {
    margin-bottom: 0.5rem !important;
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Force the view-toggle-container to not float */
.view-toggle-container {
    position: static !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
}

/* Make the button look like a select element */
.view-toggle-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    
    width: 100% !important;
    min-width: auto !important;
    max-width: none !important;
    
    padding: 0.75rem !important;
    margin: 0 !important;
    
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    
    /* Remove all fancy styling */
    box-shadow: none !important;
    background-image: none !important;
    background-size: auto !important;
    background-position: auto !important;
    background-repeat: no-repeat !important;
    
    /* Remove transforms and animations for desktop */
    transform: none !important;
    animation: none !important;
    
    /* Ensure it stays in place */
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    
    /* Text styling */
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    
    /* Remove gradients */
    background: rgba(255, 255, 255, 0.08) !important;
}

.view-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: none !important;
    box-shadow: none !important;
    animation: none !important;
}

.view-toggle-btn:active,
.view-toggle-btn:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    outline: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Ensure the label is properly positioned */
.filter-group label {
    margin-bottom: 0.5rem !important;
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
}

/* Override any mobile-specific styles for desktop */
@media (min-width: 769px) {
    .view-toggle-container {
        position: static !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: none !important;
        backdrop-filter: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: auto !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: auto !important;
        height: auto !important;
    }
    
    .view-toggle-btn {
        width: 100% !important;
        height: 44px !important;
        padding: 0.75rem !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        color: #fff !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
        font-weight: 400 !important;
        
        /* Kill all animations and transforms */
        transform: none !important;
        animation: none !important;
        transition: background-color 0.2s ease, border-color 0.2s ease !important;
        
        /* Remove gradients and shadows */
        background-image: none !important;
        box-shadow: none !important;
    }
    
    .view-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.12) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Special mobile handling - keep it nice but positioned correctly */
@media (max-width: 768px) {
    .view-toggle-container {
        margin: 1rem 0 !important;
        padding: 0 !important;
    }
    
    .view-toggle-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        border: none !important;
        color: white !important;
        font-weight: 600 !important;
        padding: 1rem 2rem !important;
        border-radius: 25px !important;
        font-size: 0.9rem !important;
    }
    
    .view-toggle-btn:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3) !important;
    }
}
