/* ============================================================================
 * FILTER SIDEBAR - the left drawer find-tutors and exams share
 * ----------------------------------------------------------------------------
 * A fixed drawer under the navbar, opened by the hamburger left of the brand
 * (js/shared/filter-sidebar.js) and closed by the overlay behind it. On a wide
 * screen #mainContent shifts across by the drawer's width; on mobile the
 * drawer sits over the page instead.
 *
 * Shared rather than copied, so both pages' filters look the same - edit here,
 * and bump the ?v on css/find-tutors.css AND branch/exams.html, which link it
 * by two different routes.
 * ==========================================================================*/
.sidebar-container {
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background: var(--sidebar-bg);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease-out;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Main Content Container */
.main-content-container,
#mainContent {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
}

/* Main Content Shifted State */
.main-content-container.shifted,
#mainContent.shifted {
    margin-left: 280px;
}

/* Mobile responsiveness for main content */
@media (max-width: 768px) {
    .main-content-container.shifted,
    #mainContent.shifted {
        margin-left: 0; /* Don't shift on mobile, sidebar overlays */
    }
}

[data-theme="dark"] .sidebar-container {
    background: var(--sidebar-bg);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-container.open {
    transform: translateX(0);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 39;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none; /* Hide overlay on desktop */
    }
}

/* Custom scrollbar for sidebar */
.sidebar-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[data-theme="dark"] .sidebar-container::-webkit-scrollbar-track {
    background: #374151;
}

.sidebar-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar-container::-webkit-scrollbar-thumb:hover {
    background: var(--button-bg);
}

.sidebar-content {
    padding: 1.5rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: -1.5rem -1.5rem 1.5rem;
    padding: 2.25rem 1rem 1rem;
    border-bottom: 2px solid rgba(var(--border-rgb), 0.1);
    background: transparent;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading);
    display: flex;
    align-items: center;
    margin: 0;
    margin-right: auto;
    min-width: 0;
}

.clear-filters-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--button-bg), var(--button-hover));
    color: var(--button-text);
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.3);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    margin: 0.375rem 0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.filter-checkbox:hover {
    background: rgba(245, 158, 11, 0.08);
    transform: translateX(4px);
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--button-bg);
}

.filter-checkbox span {
    color: var(--text);
    font-size: 0.95rem;
}

.filter-select,
.rating-input,
.price-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.625rem;
    background: var(--sidebar-bg);
    color: var(--text);
    transition: var(--transition);
    font-size: 0.95rem;
}

[data-theme="dark"] .filter-select,
[data-theme="dark"] .rating-input,
[data-theme="dark"] .price-input {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.filter-select:focus,
.rating-input:focus,
.price-input:focus {
    outline: none;
    border-color: var(--button-bg);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.rating-inputs,
.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-input,
.price-input {
    flex: 1;
}

