/* ============================================
   TUTINGO DESIGN SYSTEM - BROWSE TEACHERS
   ============================================ */

:root {
    /* Backgrounds */
    --bg-page: var(--tg-c-cream);
    --bg-white: var(--tg-c-white);
    --bg-soft: var(--tg-c-beige);
    --bg-muted: var(--tg-x-bg-eceae5);
    --bg-warm: var(--tg-x-bg-fbf9f3);
    
    /* Text */
    --text-dark: var(--tg-x-t-1f2937);
    --text-body: var(--tg-t-600);
    --text-muted: var(--tg-t-400);
    --text-light: var(--tg-t-300);
    
    /* Brand */
    --brand: #3F3896;
    --brand-hover: #5048A8;
    --brand-soft: rgba(63, 56, 150, 0.08);
    --brand-softer: rgba(63, 56, 150, 0.04);
    
    /* Accent Colors - Breaking Purple Monotony */
    --accent-teal: #0D9488;
    --accent-teal-soft: rgba(13, 148, 136, 0.08);
    --accent-gold: #B8860B;
    --accent-gold-soft: rgba(184, 134, 11, 0.1);
    --accent-coral: #F97316;
    --accent-coral-soft: rgba(249, 115, 22, 0.08);
    --accent-indigo: #6366F1;
    --accent-indigo-soft: rgba(99, 102, 241, 0.08);
    
    /* Status Colors */
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.08);
    --warning: #D97706;
    --warning-soft: rgba(217, 119, 6, 0.08);
    --danger: #DC2626;
    --danger-soft: rgba(220, 38, 38, 0.08);
    --info: var(--tg-x-t-0284c7);
    --info-soft: rgba(2, 132, 199, 0.08);
    
    /* Borders & Shadows */
    --border: var(--tg-c-gray-200);
    --border-light: var(--tg-c-gray-100);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-xl: 0 12px 32px rgba(0,0,0,0.1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Override master layout */
.page-content { padding: 0 !important; }
.container-fluid { padding: 0 !important; max-width: 100% !important; }
.main-content {
    margin-top: 0;  
    margin-bottom: 0;
}

#layout-wrapper{
        margin-top: 4rem;
    margin-bottom: 9rem;
}


.filter-sidebar{
    /*margin-top: 3rem;*/
}

@media (min-width: 1024px) {
    .main-content {
        margin-top: 6rem;
        margin-bottom: 4rem;
    }
}

/* ============================================
   PAGE LAYOUT - FULL WIDTH
   ============================================ */

.browse-page {
    min-height: 100vh;
    padding: 0;
}

.browse-container {
    display: block;
    width: 100%;
    padding: 0;
}

@media (min-width: 1024px) {
    .browse-container {
        display: grid;
        grid-template-columns: 340px 1fr;
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
}

@media (min-width: 1280px) {
    .browse-container {
        grid-template-columns: 390px 1fr;
        gap: 2rem;
        padding: 0 2rem;
    }
}

@media (min-width: 1536px) {
    .browse-container {
        grid-template-columns: 420px 1fr;
    }
}

/* ============================================
   FILTER SIDEBAR
   ============================================ */

.filter-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .filter-sidebar {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 8.5rem;
        height: calc(100vh - 10rem);
        background: var(--bg-white);
        border: 1px solid var(--border);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-md);
        overflow: hidden;
        z-index: 99; /* Below topbar (1000) to prevent overlap on scroll */
    }
}

/* Filter Header */
.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.filter-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-header-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #0F766E 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
}

.filter-header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.filter-header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.clear-all-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clear-all-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Filter Body - Scrollable */
.filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.filter-body::-webkit-scrollbar {
    width: 5px;
}

.filter-body::-webkit-scrollbar-track {
    background: transparent;
}

.filter-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.filter-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Filter Section */
.filter-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

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

.filter-section-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}

.filter-section-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.filter-section-icon.teal {
    background: var(--accent-teal-soft);
    color: var(--accent-teal);
}

.filter-section-icon.coral {
    background: var(--accent-coral-soft);
    color: var(--accent-coral);
}

.filter-section-icon.indigo {
    background: var(--accent-indigo-soft);
    color: var(--accent-indigo);
}

.filter-section-icon.gold {
    background: var(--accent-gold-soft);
    color: var(--accent-gold);
}

.filter-section-icon.brand {
    background: var(--brand-soft);
    color: var(--brand);
}

.filter-section-icon.success {
    background: var(--success-soft);
    color: var(--success);
}

.filter-section-icon.info {
    background: var(--info-soft);
    color: var(--info);
}

.filter-section-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

.filter-section-action {
    width: 32px;
    height: 32px;
    background: var(--accent-teal);
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-section-action:hover {
    background: #0F766E;
    transform: scale(1.05);
}

/* Radius Display */
.radius-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--brand-soft) 0%, rgba(63, 56, 150, 0.04) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.radius-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
}

.radius-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand);
    opacity: 0.7;
}

/* Custom Range Slider */
.filter-slider {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0.5rem 0;
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--brand);
    cursor: grab;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.filter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(63, 56, 150, 0.3);
}

.filter-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.filter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--brand);
    cursor: grab;
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Search Input */
.filter-input-wrapper {
    position: relative;
}

.filter-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

.filter-input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-coral);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px var(--accent-coral-soft);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

/* Format Buttons */
.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-soft);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
    transition: var(--transition);
}

.format-btn i {
    font-size: 1.125rem;
}

.format-btn:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: var(--accent-indigo-soft);
}

.format-btn.active {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, #4F46E5 100%);
    border-color: var(--accent-indigo);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Filtre Villes : choix du pays */
.city-country-select {
    width: 100%;
    min-height: 40px;
    margin-bottom: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    background-color: var(--bg-soft);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
}
[dir="rtl"] .city-country-select {
    padding: 0.5rem 0.875rem 0.5rem 2rem;
    background-position: left 0.875rem center;
}
.city-country-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Custom Multi-Select */
.custom-multiselect {
    position: relative;
}

.multiselect-input {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 2.5rem 0.5rem 0.875rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    transition: var(--transition);
    font-size: 0.875rem;
}

.multiselect-input:hover {
    border-color: var(--text-muted);
}

.multiselect-input.active {
    border-color: var(--brand);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.multiselect-input input {
    flex: 1;
    min-width: 80px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.multiselect-input input::placeholder {
    color: var(--text-muted);
}

.multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--brand);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    animation: tagIn 0.2s ease;
}

/* Rayon de recherche autour de l'élève : contour qui défile + respiration du fond */
.tg-search-radius {
    animation: tgRadiusDash 1.2s linear infinite, tgRadiusBreath 2.4s ease-in-out infinite;
}
@keyframes tgRadiusDash { to { stroke-dashoffset: -24; } }
@keyframes tgRadiusBreath { 0%, 100% { fill-opacity: 0.10; } 50% { fill-opacity: 0.20; } }
@media (prefers-reduced-motion: reduce) {
    .tg-search-radius { animation: none; }
}

@keyframes tagIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.multiselect-tag-remove {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    font-size: 0.625rem;
    transition: var(--transition);
}

.multiselect-tag-remove:hover {
    background: var(--tg-veil-50);
}

.multiselect-chevron {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: transform 0.2s;
}

.multiselect-input.active + .multiselect-chevron {
    transform: translateY(-50%) rotate(180deg);
    color: var(--brand);
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.multiselect-dropdown.active {
    display: block;
}

.multiselect-dropdown-search {
    padding: 0.625rem;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 1;
}

.multiselect-dropdown-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    outline: none;
    transition: var(--transition);
}

.multiselect-dropdown-search input:focus {
    border-color: var(--brand);
}

.multiselect-options {
    padding: 0.375rem;
}

.multiselect-option {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-body);
}

.multiselect-option:hover {
    background: var(--bg-soft);
    color: var(--text-dark);
}

.multiselect-option.selected {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.multiselect-option-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.625rem;
}

.multiselect-option.selected .multiselect-option-check {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

.multiselect-option.selected .multiselect-option-check::after {
    content: "✓";
}

/* Price Range Inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.price-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-input-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.price-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.price-input-wrapper:focus-within {
    border-color: var(--accent-gold);
    background: var(--bg-white);
}

.price-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    outline: none;
    width: 100%;
}

.price-currency {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.price-separator {
    color: var(--text-light);
    font-weight: 600;
}

/* Rating Options */
.rating-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-option {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.rating-option:hover {
    border-color: var(--warning);
    background: var(--warning-soft);
}

.rating-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 0.625rem;
    cursor: pointer;
    accent-color: var(--warning);
}

.rating-option:has(input:checked) {
    border-color: var(--warning);
    background: var(--warning-soft);
}

.rating-option-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rating-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-body);
}

.rating-option:has(input:checked) .rating-text {
    color: var(--warning);
    font-weight: 600;
}

.rating-stars {
    display: flex;
    gap: 2px;
    color: var(--warning);
    font-size: 0.75rem;
}

.rating-stars .far {
    opacity: 0.3;
}

/* Filter Footer */
.filter-footer {
    padding: 1rem 1.25rem;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.filter-apply-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #0F766E 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.filter-clear-btn {
    width: 100%;
    margin-top: 0.625rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.filter-clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-soft);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-area {
    padding: 1rem;
}

@media (min-width: 1024px) {
    .main-area {
        padding: 0;
    }
}

/* Results Header */
.results-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .results-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    



}

.results-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem;
}

@media (min-width: 1024px) {
    .results-info h1 {
        font-size: 1.75rem;
    }
}

.results-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.results-count strong {
    color: var(--accent-teal);
    font-weight: 700;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-select {
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.sort-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Map Container */
.map-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

#main-map {
    height: 500px;
    width: 100%;
    background-color: var(--tg-c-ddd);
}

/* Ensure Leaflet elements are visible */
#main-map .leaflet-tile-pane,
#main-map .leaflet-tile-container,
#main-map .leaflet-layer,
#main-map .leaflet-tile {
    visibility: visible !important;
    opacity: 1 !important;
}

#main-map .leaflet-pane {
    z-index: 400;
}

#main-map .leaflet-tile-pane {
    z-index: 200;
}

/* ============================================
   TEACHER CARDS - MODERN REDESIGN
   ============================================ */

.teachers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .teachers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    


}

@media (min-width: 1536px) {
    .teachers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.teacher-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-slow);
    position: relative;
}

.teacher-card:hover {
    border-color: var(--brand-soft);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* Top Badge */
.teacher-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
}

.badge-top-rated {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--warning) 0%, #B45309 100%);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 0 var(--radius-xl) 0 var(--radius-lg);
}

.badge-highly-rated {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 0 var(--radius-xl) 0 var(--radius-lg);
}

/* Card Body */
.teacher-card-body {
    padding: 1.5rem;
}

/* Teacher Header */
.teacher-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.teacher-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.teacher-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.teacher-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.teacher-status-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--success);
    border: 2px solid var(--bg-white);
    border-radius: 50%;
    animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
}

.teacher-info {
    flex: 1;
    min-width: 0;
}

.teacher-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.teacher-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.teacher-name a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.teacher-name a:hover {
    color: var(--brand);
}

.teacher-verified {
    width: 16px;
    height: 16px;
    background: var(--success);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teacher-verified i {
    font-size: 0.5rem;
    color: white;
}

.teacher-actions-top {
    display: flex;
    gap: 0.375rem;
}

.action-btn-sm {
    width: 32px;
    height: 32px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.action-btn-sm:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

.action-btn-sm.active {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Location & Distance */
.teacher-location {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.teacher-location i {
    color: var(--accent-coral);
}

.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--info-soft);
    color: var(--info);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

/* Rating */
.teacher-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 1px;
    color: var(--warning);
    font-size: 0.75rem;
}

.rating-stars i.empty {
    color: var(--border);
}

.rating-score {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

.rating-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rating-new {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rating-new i {
    color: var(--warning);
}

/* Subject & Price Row */
.teacher-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.teacher-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1;
}

.subject-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.subject-badge.primary {
    background: var(--brand-soft);
    color: var(--brand);
}

.subject-badge.teal {
    background: var(--accent-teal-soft);
    color: var(--accent-teal);
}

.subject-badge.coral {
    background: var(--accent-coral-soft);
    color: var(--accent-coral);
}

.subject-badge.more {
    background: var(--bg-muted);
    color: var(--text-muted);
}

.teacher-price {
    text-align: right;
    flex-shrink: 0;
}

.price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.2;
}

.price-starting {
    font-size: 0.625rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1;
}

.price-unit {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Bio */
.teacher-bio {
    font-size: 0.8125rem;
    color: var(--text-body);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Format Tags */
.teacher-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.format-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.format-tag.online {
    background: var(--info-soft);
    color: var(--info);
}

.format-tag.in-person {
    background: var(--success-soft);
    color: var(--success);
}

.format-tag.experience {
    background: var(--bg-muted);
    color: var(--text-body);
}

/* Card Actions */
.teacher-card-actions {
    display: flex;
    gap: 0.625rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.btn-view-profile {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-view-profile:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.btn-book-session {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #0F766E 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-book-session:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
    color: white;
}

.btn-book-session.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

@media (min-width: 640px) {
    .pagination-wrapper {
        flex-direction: row;
        justify-content: space-between;
    }

}

@media (max-width: 720px){
        #layout-wrapper{
        margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}


.filter-sidebar{
    margin-top: 0.1rem;
}
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-info strong {
    color: var(--brand);
    font-weight: 700;
}

.pagination {
    display: flex;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.pagination .page-item .page-link:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: var(--bg-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state-icon i {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.empty-state h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.empty-state-btn.primary {
    background: var(--brand);
    color: white;
    border: none;
}

.empty-state-btn.primary:hover {
    background: var(--brand-hover);
}

.empty-state-btn.secondary {
    background: var(--bg-white);
    color: var(--text-body);
    border: 1px solid var(--border);
}

.empty-state-btn.secondary:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 247, 244, 0.9);
    backdrop-filter: blur(4px);
    z-index: 9999;
}

.spinner-custom {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.custom-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-toast.show {
    transform: translateX(0);
}

.custom-toast-success {
    border-left: 4px solid var(--success);
}

.custom-toast-error {
    border-left: 4px solid var(--danger);
}

.custom-toast-icon {
    font-size: 1.25rem;
}

.custom-toast-success .custom-toast-icon {
    color: var(--success);
}

.custom-toast-error .custom-toast-icon {
    color: var(--danger);
}

.custom-toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.custom-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    transition: var(--transition);
}

.custom-toast-close:hover {
    color: var(--text-dark);
}

/* ============================================
   MAP POPUP STYLES
   ============================================ */

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 100% !important;
}

.custom-popup .leaflet-popup-content-wrapper {
    background: var(--tg-c-white);
}

.teacher-map-popup {
    width: 300px;
    max-width: calc(100vw - 48px);
    font-family: 'Inter', sans-serif;
}

.tmp-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 2rem 0.75rem 1rem;
    text-decoration: none !important;
    color: inherit !important;
}

.tmp-avatar {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.tmp-avatar img,
.tmp-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.tmp-avatar img {
    object-fit: cover;
    display: block;
}

.tmp-avatar-placeholder {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.tmp-verified {
    position: absolute;
    right: -2px;
    bottom: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #059669;
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.tmp-identity {
    flex: 1;
    min-width: 0;
}

.tmp-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmp-header:hover .tmp-name {
    color: var(--brand);
}

.tmp-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: var(--text-dark);
}

.tmp-stars {
    color: #F59E0B;
    font-size: 0.8125rem;
    letter-spacing: -1px;
}

.tmp-muted {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.tmp-new {
    color: #B45309;
    background: #FEF3C7;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

.tmp-location {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.625rem;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tmp-distance {
    color: var(--brand);
    font-weight: 600;
}

.tmp-body {
    padding: 0 1rem 0.875rem;
}

.tmp-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
}

.tmp-chip {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: #EEEDF8;
    color: var(--brand);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmp-chip.matched {
    background: var(--brand);
    color: #fff;
}

.tmp-chip.more {
    background: var(--bg-soft);
    color: var(--text-muted);
}

.tmp-bio {
    font-size: 0.75rem;
    line-height: 1.45;
    color: #4B5563;
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tmp-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.tmp-formats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tmp-format {
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tmp-format.online {
    color: #0F766E;
}

.tmp-format.in-person {
    color: #9A3412;
}

.tmp-price {
    text-align: end;
    line-height: 1.1;
    flex-shrink: 0;
}

.tmp-price-from,
.tmp-price-unit {
    display: block;
    font-size: 0.625rem;
    color: var(--text-muted);
}

.tmp-price-amount {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand);
}

.tmp-price-amount small {
    font-size: 0.6875rem;
    font-weight: 700;
}

.tmp-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.popup-btn {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.popup-btn-primary {
    background: var(--brand);
    color: white !important;
}

.popup-btn-primary:hover {
    background: var(--brand-hover);
}

.popup-btn-success {
    background: var(--accent-teal);
    color: white !important;
}

.popup-btn-success:hover {
    background: #0F766E;
}

.popup-btn-favorite {
    width: 36px;
    flex: none;
    background: var(--bg-white);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.popup-btn-favorite:hover {
    background: var(--danger-soft);
}

.popup-btn-favorite.active {
    background: var(--danger);
    color: white;
}

/* User Location Marker */
.user-location-marker {
    background-color: transparent !important;
    border: none !important;
}

.user-location-marker i {
    color: var(--danger);
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.4));
    animation: bounce-pin 2s ease-in-out infinite;
}

@keyframes bounce-pin {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Teacher Marker */
.teacher-marker {
    background-color: var(--brand);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.teacher-marker:hover {
    transform: scale(1.1);
    z-index: 1000;
}

.teacher-marker-with-image {
    width: 54px !important;
    height: 54px !important;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--tg-c-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.teacher-marker-with-image:hover {
    transform: scale(1.15);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.teacher-marker-with-image img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

/* Marker Cluster Styles */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 36px;
    height: 36px;
    margin-left: 4px;
    margin-top: 4px;
    text-align: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.marker-cluster-small {
    background-color: rgba(63, 56, 150, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(63, 56, 150, 0.9);
}

.marker-cluster-medium {
    background-color: rgba(13, 148, 136, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(13, 148, 136, 0.9);
}

.marker-cluster-large {
    background-color: rgba(249, 115, 22, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(249, 115, 22, 0.9);
}

/* ============================================
   MOBILE STYLES
   ============================================ */

.mobile-only-container {
    display: block;
}

@media (min-width: 1024px) {
    .mobile-only-container {
        display: none !important;
    }
}

.desktop-only {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-only {
        display: block;
    }
}

/* Mobile Map Container */
.mobile-map-container {
    position: relative;
    width: 100%;
    height: 45vh !important;
    min-height: 400px;
    background: var(--bg-soft);
}

.mobile-map-container #mobile-main-map {
    height: 100%;
    width: 100%;
    background-color: var(--tg-c-ddd);
}

/* Ensure Leaflet elements are visible on mobile */
#mobile-main-map .leaflet-tile-pane,
#mobile-main-map .leaflet-tile-container,
#mobile-main-map .leaflet-layer,
#mobile-main-map .leaflet-tile {
    visibility: visible !important;
    opacity: 1 !important;
}

#mobile-main-map .leaflet-pane {
    z-index: 400;
}

#mobile-main-map .leaflet-tile-pane {
    z-index: 200;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 450; /* Above map elements (100-400), below topbar (1000) */
    display: flex;
    gap: 0.75rem;
}

.mobile-search-box {
    flex: 1;
    background: var(--bg-white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    position: relative;
}

.mobile-search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.mobile-search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
    color: var(--text-dark);
    background: transparent;
}

.mobile-search-box input::placeholder {
    color: var(--text-muted);
}

.mobile-location-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-teal);
    font-size: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-location-btn:hover {
    background: var(--accent-teal);
    color: white;
}

/* Mobile Quick Filters */
.mobile-quick-filters {
    background: var(--bg-white);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-quick-filters::-webkit-scrollbar {
    display: none;
}

.mobile-filter-chips {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-white);
    color: var(--text-body);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
}

.filter-chip.active {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: white;
}

/* Mobile Radius Control */
.mobile-radius-control {
    background: var(--bg-white);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-radius-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-radius-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.mobile-radius-label i {
    color: var(--accent-teal);
}

.mobile-radius-slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-radius-slider {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.mobile-radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-teal);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.4);
}

.mobile-radius-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-teal);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.4);
}

.mobile-radius-value {
    min-width: 50px;
    padding: 0.375rem 0.5rem;
    background: var(--accent-teal-soft);
    color: var(--accent-teal);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Mobile Results Bar */
.mobile-results-bar {
    padding: 0.875rem 1rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99; /* Below topbar (1000) to prevent overlap on scroll */
}

.mobile-results-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mobile-results-count span {
    color: var(--accent-teal);
    font-weight: 700;
}

.mobile-sort-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-body);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

/* Mobile Teachers Container */
.mobile-teachers-container {
    padding: 1rem;
    background: var(--bg-page);
    padding-bottom: 7rem;
}

/* Mobile Filter FAB - Stacked vertically above support button */
.mobile-filter-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 10rem; /* Above support button (support is at 5.5rem + 54px height + gap) */
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #0F766E 100%);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: var(--transition-slow);
    cursor: pointer;
}

/* Desktop - higher position not needed */
@media (min-width: 1024px) {
    .mobile-filter-fab {
        display: none;
    }
}

.mobile-filter-fab:hover {
    transform: scale(1.1);
}

.mobile-filter-fab i {
    font-size: 1.25rem;
}

.mobile-filter-fab.has-filters::after {
    content: attr(data-filter-count);
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Filter Sheet (Bottom Sheet) */
.mobile-filter-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-filter-sheet-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mobile-filter-sheet {
    position: fixed;
    bottom: 5rem;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateY(calc(100% + 5rem));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 8rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mobile-filter-sheet.active {
    transform: translateY(0);
}

.mobile-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0.75rem auto 0.5rem;
    flex-shrink: 0;
}

.mobile-sheet-header {
    padding: 0.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.mobile-sheet-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.mobile-sheet-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-sheet-close:hover {
    background: var(--bg-muted);
    color: var(--text-dark);
}

.mobile-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: var(--bg-page);
}

.mobile-sheet-content::-webkit-scrollbar {
    width: 4px;
}

.mobile-sheet-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.mobile-sheet-actions {
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mobile-apply-filters-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #0F766E 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mobile-clear-filters-btn {
    padding: 0.875rem 1.25rem;
    background: var(--bg-white);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-clear-filters-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Mobile Filter Groups */
.mobile-filter-group {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
}

.mobile-filter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.mobile-filter-header i {
    font-size: 1rem;
    color: var(--accent-teal);
}

.mobile-filter-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

/* Mobile Radius Display */
.radius-display-mobile {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--brand-soft) 0%, rgba(63, 56, 150, 0.04) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.radius-value-large {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
}

.radius-unit-mobile {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand);
    opacity: 0.7;
}

/* Mobile Slider */
.mobile-radius-slider {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0.5rem 0;
}

.mobile-radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--brand);
    cursor: grab;
    box-shadow: var(--shadow-md);
}
/* Mobile Format Grid */
.mobile-format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.mobile-format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.875rem 0.5rem;
    background: var(--bg-soft);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-format-btn i {
    font-size: 1.25rem;
}

.mobile-format-btn.active {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, #4F46E5 100%);
    border-color: var(--accent-indigo);
    color: white;
}

/* Mobile Filter Input */
.mobile-input-wrapper {
    position: relative;
}

.mobile-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.mobile-filter-input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.mobile-filter-input:focus {
    outline: none;
    border-color: var(--accent-coral);
    background: var(--bg-white);
}

/* Mobile Price Inputs */
.mobile-price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.mobile-price-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.mobile-price-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mobile-price-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.mobile-price-input-wrapper:focus-within {
    border-color: var(--accent-gold);
    background: var(--bg-white);
}

.mobile-price-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
    outline: none;
    width: 100%;
}

.mobile-price-currency {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.mobile-price-separator {
    color: var(--text-light);
    font-weight: 600;
    padding-bottom: 0.625rem;
}

/* Mobile Rating Options */
.mobile-rating-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-rating-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-rating-option:has(input:checked) {
    border-color: var(--warning);
    background: var(--warning-soft);
}

.mobile-rating-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--warning);
}

.mobile-rating-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-rating-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-body);
}

.mobile-rating-option:has(input:checked) .mobile-rating-text {
    color: var(--warning);
    font-weight: 600;
}

.mobile-rating-stars {
    display: flex;
    gap: 2px;
    color: var(--warning);
    font-size: 0.75rem;
}

.mobile-rating-stars .far {
    opacity: 0.3;
}

/* Mobile Multiselect in Sheet */
.mobile-sheet-content .custom-multiselect .multiselect-dropdown {
    z-index: 2500;
}

.mobile-sheet-content .multiselect-input {
    min-height: 48px;
}

/* ============================================
   LOGIN REQUIRED MODAL
   ============================================ */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.login-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.login-modal-box {
    background: var(--tg-c-white);
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    position: relative;
}

.login-modal-overlay.active .login-modal-box {
    transform: scale(1);
    opacity: 1;
}

.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--tg-t-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.login-modal-close:hover {
    color: var(--tg-t-600);
    background: var(--tg-c-gray-100);
}

.login-modal-icon {
    width: 48px;
    height: 48px;
    color: var(--tg-a-brand);
    margin: 0 auto 16px;
    display: block;
}

.login-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-x-t-1f2937);
    text-align: center;
    margin: 0 0 16px 0;
}

.login-modal-message {
    font-size: 16px;
    color: var(--tg-t-600);
    line-height: 1.5;
    text-align: center;
    margin: 0 0 24px 0;
}

.login-modal-btn-primary {
    display: block;
    width: 100%;
    background: #3F3896;
    color: #FFFFFF;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-modal-btn-primary:hover {
    background: #352F7E;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.login-modal-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.login-modal-divider span {
    color: var(--tg-t-400);
    font-size: 14px;
}

.login-modal-divider::before,
.login-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tg-c-gray-200);
}

.login-modal-btn-secondary {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--tg-a-brand);
    padding: 12px 28px;
    border: 2px solid #3F3896;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-modal-btn-secondary:hover {
    background: var(--tg-s-violet-50);
    color: var(--tg-a-brand);
}

@media (max-width: 480px) {
    .login-modal-box {
        padding: 24px;
    }
    .login-modal-btn-primary,
    .login-modal-btn-secondary {
        font-size: 14px;
    }
}

/* ============================================
   MODE SOMBRE : textes en blanc (19/11/2026)
   Les textes violets / gris-bleu étaient peu lisibles sur fond sombre.
   ============================================ */
[data-bs-theme="dark"] {
    --text-dark: #FFFFFF;
    --text-body: #E7E9EE;
    --text-muted: #B9C0CC;
}

[data-bs-theme="dark"] .radius-value,
[data-bs-theme="dark"] .radius-unit,
[data-bs-theme="dark"] .radius-value-large,
[data-bs-theme="dark"] .radius-unit-mobile,
[data-bs-theme="dark"] .multiselect-option.selected,
[data-bs-theme="dark"] .price-amount,
[data-bs-theme="dark"] .pagination-info strong,
[data-bs-theme="dark"] .teacher-name a:hover,
[data-bs-theme="dark"] .tmp-header:hover .tmp-name,
[data-bs-theme="dark"] .tmp-distance,
[data-bs-theme="dark"] .tmp-price-amount,
[data-bs-theme="dark"] .tmp-bio {
    color: #FFFFFF;
}

/* Pastilles (matières, formats) : texte blanc, fond teinté un peu plus marqué */
[data-bs-theme="dark"] .subject-badge,
[data-bs-theme="dark"] .format-tag,
[data-bs-theme="dark"] .tmp-chip,
[data-bs-theme="dark"] .tmp-format {
    color: #FFFFFF;
}
[data-bs-theme="dark"] .subject-badge.primary,
[data-bs-theme="dark"] .tmp-chip { background: rgba(124, 115, 230, 0.28); }
[data-bs-theme="dark"] .subject-badge.teal { background: rgba(13, 148, 136, 0.28); }
[data-bs-theme="dark"] .subject-badge.coral { background: rgba(249, 115, 22, 0.24); }
[data-bs-theme="dark"] .format-tag.online { background: rgba(2, 132, 199, 0.28); }
[data-bs-theme="dark"] .format-tag.in-person { background: rgba(5, 150, 105, 0.28); }
[data-bs-theme="dark"] .tmp-chip.matched { background: var(--brand); }

/* Bouton « Voir sur la carte » à côté de « Voir le profil » (19/11/2026) */
.btn-show-on-map {
    flex: none;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--brand);
    font-size: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-show-on-map:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}
[data-bs-theme="dark"] .btn-show-on-map { color: #FFFFFF; }
/* Petit écran : « Voir le profil » + carte sur une ligne, « Réserver une séance » en dessous, pleine largeur */
@media (max-width: 480px) {
    .teacher-card-actions { flex-wrap: wrap; gap: 0.5rem; }
    .teacher-card-actions .btn-book-session { flex: 1 1 100%; }
    .btn-show-on-map { width: 48px; }
}
