/* ==========================================================
   HOME.CSS – InovEdu Africa School Directory Homepage
   Mobile-first, BEM-ish naming, consistent styling
   Version: 1.1 | Organized by HTML Blocks
   ========================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* Font Variables */
:root {
    --font-primary: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-heading: 'Poppins', 'Inter', system-ui, sans-serif;
}


/* ==========================================================
   BLOCK 1: SCHOOL EXPLORER HEADER & SEARCH SYSTEM
   ========================================================== */

/* 1-1. EXPLORER HEADER CONTAINER */

.explorer-header {
    position: sticky;
    top: 61px;
    z-index: 998;
    background:  #2c3e50 ;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
    padding: var(--space-md) var(--space-xl);
    transition: all var(--transition-base);
}




.explorer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="%23F3AD1C" opacity="0.1"><polygon points="0,0 1000,50 1000,100 0,100"/></svg>'); /* Changed to hero yellow with opacity */
    background-size: cover;
}

/* 1-2. EXPLORER TITLE */
.explorer-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: var(--font-heading);
}

/* 1-3. SEARCH CONTAINER - DESKTOP */
.search-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
    top: 9px;
}

/* 1-4. SEARCH INPUT WRAPPER */
.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 400px;
    max-width: 600px;
    display: flex;
    align-items: center;
}

#search {
    width: 100%;
    padding: 14px 100px 14px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    font-weight: 500;
}

#search:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: white;
    transform: translateY(-2px);
}

/* 1-5. CLEAR BUTTON */
.clear-btn {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* 1-6. ACTION BUTTONS CONTAINER */
.search-buttons-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 1-7. PRIMARY ACTION BUTTONS */
.search-btn,
.reset-btn,
.filter-toggle-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: var(--font-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Search Button - Use hero yellow */
.search-btn {
    background: linear-gradient(135deg, #F3AD1C, #e69c1a); /* Hero yellow gradient */
    color: white;
    justify-content: center;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 173, 28, 0.4); /* Yellow shadow */
    background: linear-gradient(135deg, #e69c1a, #d18c16); /* Darker yellow on hover */
}

/* Reset Button */
.reset-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    min-width: 120px;
    justify-content: center;
}

.reset-btn:hover {
    background: white;
    color: #333;
    transform: translateY(-2px);
}

/* Search button inside input wrapper */
.search-input-wrapper .search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #F3AD1C, #e69c1a); /* Hero yellow */
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 8px rgba(243, 173, 28, 0.3); /* Yellow shadow */
}

.search-input-wrapper .search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(243, 173, 28, 0.4); /* Stronger yellow shadow */
}

/* 1-8. FILTER TOGGLE BUTTON */
.filter-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    position: relative;
    min-width: 100px;
    justify-content: center;
}

.filter-toggle-btn:hover {
    background: white;
    color: #333;
    transform: translateY(-2px);
}

.filter-badge {
    background: #F3AD1C; /* Hero yellow for badge */
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    font-weight: 600;
}

/* 1-9. SEARCH SPINNER */
#schoolsSpinner {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    display: none;
}

/* 1-10. MOBILE VERSION ADJUSTMENTS */
@media (max-width: 768px) {
    .explorer-header {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .search-input-wrapper {
        min-width: unset;
        max-width: unset;
    }
    
    #search {
        padding: 12px 80px 12px 15px;
    }
    
    .search-btn,
    .reset-btn,
    .filter-toggle-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .search-input-wrapper .search-btn {
        width: 32px;
        height: 32px;
    }
}


/* ==========================================================
   BLOCK 2: SEARCH SUGGESTIONS SYSTEM
   ========================================================== */

.search-suggestions {
    position: absolute;
    /* REMOVE THIS: transform: translateX(+14%) !important; */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10000 !important;
    margin-top: 4px;
}


.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    z-index: 10002;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-main {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.suggestion-logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #f0f5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 16px;
    color: #3287FF;
    border: 1px solid #e1e8ff;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.suggestion-type {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    color: #495057;
}

.suggestion-location {
    color: #6c757d;
    font-size: 11px;
}

.suggestion-actions {
    flex-shrink: 0;
    margin-left: 12px;
}

.btn-preview {
    background: #3287FF;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-preview:hover {
    background: #2a75e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(50, 135, 255, 0.3);
}

.suggestion-filter-info {
    padding: 8px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.highlight {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 700;
    color: #856404;
}

.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==========================================================
   BLOCK 3: FILTER DRAWER SYSTEM
   ========================================================== */

.filter-dropdown-container {
    position: relative;
    display: inline-block;
}

.filter-card {
    display: none;
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    z-index: 10000;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(0, 0, 128, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.filter-card.active {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    right: 0 !important;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        right: -400px;
        opacity: 0;
    }

    to {
        right: 0;
        opacity: 1;
    }
}

.filter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-backdrop.active {
    display: block !important;
    opacity: 1;
}

.filter-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 128, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
}

.filter-card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000080;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-card-close {
    background: rgba(0, 0, 128, 0.1);
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.filter-card-close:hover {
    background: rgba(0, 0, 128, 0.15);
    color: #000080;
    transform: scale(1.1);
}

.filter-card-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

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

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

.filter-card-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 128, 0.3);
    border-radius: 3px;
}

.filter-card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 128, 0.5);
}

.filter-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 128, 0.08);
    transition: all 0.3s ease;
}

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

.filter-section:hover {
    background: rgba(0, 0, 128, 0.02);
}

.filter-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
}

.filter-section-title i {
    color: #000080;
    width: 16px;
    text-align: center;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    font-weight: 500;
    color: #334155;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.filter-select:focus {
    outline: none;
    border-color: #000080;
    box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.1);
    transform: translateY(-1px);
}

.filter-select:disabled {
    background-color: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.active-filters-display {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
    padding: 12px;
    background: rgba(0, 0, 128, 0.03);
    border-radius: 8px;
    border-left: 3px solid #000080;
}

.active-filter-item {
    display: inline-block;
    background: rgba(0, 0, 128, 0.1);
    color: #000080;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 2px 4px 2px 0;
    font-size: 0.8rem;
    font-weight: 500;
}

.filter-card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 128, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: rgba(248, 250, 252, 0.8);
    flex-shrink: 0;
}

.filter-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary);
    min-width: 100px;
    justify-content: center;
}

.filter-btn-primary {
    background: linear-gradient(135deg, #000080 0%, #4a6fff 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 128, 0.2);
}

.filter-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 128, 0.3);
    background: linear-gradient(135deg, #000066 0%, #3a5fef 100%);
}

.filter-btn-secondary {
    background: rgba(0, 0, 128, 0.08);
    color: #475569;
    border: 1px solid rgba(0, 0, 128, 0.1);
}

.filter-btn-secondary:hover {
    background: rgba(0, 0, 128, 0.12);
    color: #000080;
    transform: translateY(-2px);
}

.filter-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-family: var(--font-primary);
    padding: 2rem;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.filter-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 128, 0.1);
    border-top: 3px solid #000080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.retry-btn {
    background: linear-gradient(135deg, #000080 0%, #4a6fff 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 128, 0.3);
}

/* ==========================================================
   BLOCK 4: SCHOOLS GRID & CARD SYSTEM
   ========================================================== */

/* .main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 40px;
} */

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #000080;
    text-align: center;
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #000080 0%, #4a6fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 2rem;
}

.school-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 128, 0.08);
    border: 1px solid rgba(0, 0, 128, 0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.school-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 128, 0.15);
    border-color: rgba(0, 0, 128, 0.2);
}

.school-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.school-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.school-card:hover .school-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

.overlay-text {
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    width: 100%;
}

.overlay-text div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.school-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--school-color, #667eea) 0%, var(--school-color-dark, #764ba2) 100%);
}

.school-initials {
    color: white;
    font-weight: 800;
    font-size: 2.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.school-info {
    padding: 20px;
}

.school-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
    line-height: 1.3;
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2em;
}

.location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #4a5568;
    flex-wrap: wrap;
}

.country-name {
    font-weight: 600;
    color: #000080;
}

.city-name {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #718096;
}

.city-name i {
    color: #000080;
    font-size: 0.8rem;
}

.category {
    font-size: 0.9rem;
    color: #0B1545;
    margin-bottom: 16px;
    padding: 6px 12px;
    background: rgba(0, 0, 128, 0.05);
    border-radius: 8px;
    border-left: 3px solid #000080;
    font-weight: 500;
}

.school-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-btn {
    background: #4692FE;
    color: white;
    border: 1px solid #4692FE;
    box-shadow: 0 2px 8px rgba(70, 146, 254, 0.3);
}

.map-btn:hover {
    background: #3a82e6;
    border-color: #3a82e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(70, 146, 254, 0.4);
}

.map-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(70, 146, 254, 0.3);
}

.details-btn {
    background: #1D4B8C;
    color: white;
    border: 1px solid #1D4B8C;
    box-shadow: 0 2px 8px rgba(29, 75, 140, 0.3);
}

.details-btn:hover {
    background: #17407a;
    border-color: #17407a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 75, 140, 0.4);
}

.details-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(29, 75, 140, 0.3);
}

.action-btn i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.action-btn:hover i {
    transform: scale(1.1);
}

.no-schools {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.view-grid .schools-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.view-list .schools-grid {
    grid-template-columns: 1fr;
    gap: 16px;
}

.view-list .school-card {
    display: flex;
    height: 160px;
}

.view-list .school-image {
    width: 200px;
    height: 100%;
    flex-shrink: 0;
}

.view-list .school-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 20px;
}

.view-list .school-actions {
    margin-top: auto;
    justify-content: flex-start;
}

.view-list .action-btn {
    flex: 0 1 auto;
    min-width: 120px;
}

/* ==========================================================
   BLOCK 5: CAROUSEL SYSTEM
   ========================================================== */

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 12px 0;
}

.carousel-container {
    width: calc(100% - 80px);
    margin: 0 auto;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
    padding: 8px 0;
    width: max-content;
}

.carousel-track .school-card {
    width: 280px;
    flex-shrink: 0;
    min-height: 320px;
}
/* 
.category-section {
    margin-bottom: 25px;
    padding: 15px 0;
} */

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.carousel-arrow.prev {
    left: 10px;
}

.carousel-arrow.next {
    right: 10px;
}

.carousel-arrow:hover {
    background: #f5f5f5;
    transform: translateY(-50%) scale(1.05);
}

.carousel-arrow svg {
    fill: #333;
    transition: fill 0.3s ease;
}

.carousel-arrow:hover svg {
    fill: #007bff;
}

.category-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mobile-school-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 10px;
}

.mobile-school-grid .school-card {
    width: 100%;
    min-height: 300px;
}

.few-schools-category {
    opacity: 0.9;
}

.few-schools-category .category-title {
    color: #666;
}

.carousel-wrapper.loading .carousel-track {
    opacity: 0.6;
}

.carousel-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

/* ==========================================================
   BLOCK 6: MOBILE SEARCH - SIMPLIFIED 3 BLOCK STRUCTURE
   ========================================================== */

/* Mobile Devices (768px and below) - SIMPLIFIED LAYOUT */
@media (max-width: 768px) {

    /* OVERRIDE: Unified search container - DIRECT CHILDREN ONLY */
    .search-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 16px;
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.1),
            inset 0 1px 2px rgba(255, 255, 255, 0.8);
        border: 1.5px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        overflow: hidden;
        height: 52px;
        gap: 0 !important;
        justify-content: space-between !important;
        position: relative;
    }

    /* REMOVE BUTTONS CONTAINER COMPLETELY */
    .search-buttons-container {
        display: none !important;
    }

    /* HIDE RESET BUTTON */
    .reset-btn {
        display: none !important;
    }

    /* PART 1: LEFT BLOCK - SEARCH ICON (FIRST CHILD) */
    .search-btn {
        flex: 0 0 auto !important;
        width: 52px !important;
        height: 100% !important;
        min-width: 52px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        justify-content: center;
        padding: 0 !important;
        border-radius: 0 !important;
        position: relative;
        transition: all 0.2s ease;
        color: #666 !important;
        margin: 0 !important;
        order: 1;
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    .search-btn i {
        font-size: 1.3rem !important;
        margin: 0 !important;
        color: inherit !important;
    }

    /* Add subtle right border separator */
    .search-btn::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 24px;
        width: 1px;
        background: rgba(0, 0, 0, 0.1);
    }

    /* PART 2: MIDDLE BLOCK - SEARCH INPUT (SECOND CHILD) */
    .search-input-wrapper {
        flex: 1;
        position: relative;
        margin: 0;
        min-width: 0 !important;
        max-width: none !important;
        order: 2;
        overflow: visible !important;
    }

    #search {
        padding: 0 16px !important;
        border: none !important;
        border-radius: 0 !important;
        font-size: 16px !important;
        background: transparent !important;
        box-shadow: none !important;
        height: 100%;
        font-weight: 500;
        width: 100%;
        backdrop-filter: none !important;
        transform: none !important;
    }

    #search:focus {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        outline: none;
    }

    /* Add subtle right border separator for search input */
    .search-input-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 24px;
        width: 1px;
        background: rgba(0, 0, 0, 0.1);
        z-index: 1;
    }

    /* CLEAR BUTTON - Inside middle block */
    .clear-btn {
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        background: rgba(0, 0, 0, 0.08) !important;
        width: 28px;
        height: 28px;
        color: #666 !important;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.8;
        transition: all 0.2s ease;
    }

    .clear-btn:hover {
        background: rgba(0, 0, 0, 0.12) !important;
        opacity: 1;
    }

    /* PART 3: RIGHT BLOCK - FILTER ICON (THIRD CHILD) */
    .filter-toggle-btn {
        flex: 0 0 auto !important;
        width: 52px !important;
        height: 100% !important;
        min-width: 52px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        justify-content: center;
        border-radius: 0 !important;
        position: relative;
        transition: all 0.2s ease;
        color: #666 !important;
        margin: 0 !important;
        order: 3;
    }

    .filter-toggle-btn i {
        color: inherit !important;
        font-size: 1.3rem !important;
        margin: 0 !important;
    }

    /* HIDE FILTER TEXT */
    .filter-toggle-btn span:not(.filter-badge) {
        display: none !important;
    }

    /* FILTER BADGE - Position on filter icon */
    .filter-badge {
        position: absolute !important;
        top: 8px;
        right: 8px;
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        background: #ff4757;
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.95);
        font-weight: 700;
    }

    /* SPINNER - Adjusted positioning */
    #schoolsSpinner {
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }



    /* Ensure the search container allows suggestions to overflow */
    /* .search-container {
        position: relative;
        overflow: visible !important;
    } */

    /* Ensure explorer header doesn't clip the suggestions */
    /* .explorer-header {
        overflow: visible !important;
        padding: 1rem !important;
    } */

    .explorer-title {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
    }

    /* FILTER CARD MOBILE - BOTTOM SHEET */
    .filter-card {
        top: auto !important;
        bottom: -100vh !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        transform: none !important;
        transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .filter-card.active {
        bottom: 0 !important;
        right: auto !important;
        animation: slideUp 0.3s ease-out !important;
    }

    @keyframes slideUp {
        from {
            bottom: -100vh;
        }
        to {
            bottom: 0;
        }
    }

    .filter-card-body {
        max-height: calc(85vh - 140px);
        padding: 1rem;
    }

    .filter-card-header {
        padding: 1.25rem;
        position: relative;
    }

    .filter-card-header::after {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #e1e8ed;
        border-radius: 2px;
    }

    .filter-card-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
        gap: 8px;
    }

    .filter-btn {
        width: 100%;
        min-width: auto;
    }

    /* SCHOOLS GRID MOBILE - 1 CARD PER ROW */
    .main-content {
        padding: 0 16px 24px;
    }

    .schools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .school-image {
        height: 160px;
    }

    .school-info {
        padding: 16px;
    }

    .school-name {
        font-size: 1.1rem;
        min-height: 2.8em;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* List view adjustments for mobile */
    .view-list .school-card {
        flex-direction: column;
        height: auto;
    }

    .view-list .school-image {
        width: 100%;
        height: 140px;
    }

    .view-list .school-actions {
        justify-content: stretch;
    }

    .view-list .action-btn {
        flex: 1;
    }

    /* CAROUSEL MOBILE ADJUSTMENTS */
    .carousel-container {
        width: calc(100% - 40px);
    }

    .carousel-arrow {
        width: 35px;
        height: 35px;
    }

    .carousel-arrow.prev {
        left: 5px;
    }

    .carousel-arrow.next {
        right: 5px;
    }

    .category-title {
        font-size: 1.25rem;
        padding: 0 15px;
        margin-bottom: 10px;
    }

    .category-section {
        margin-bottom: 20px;
        padding: 12px 0;
    }

    .carousel-wrapper {
        margin: 10px 0;
    }

    /* Smaller cards for tablet */
    .carousel-track .school-card {
        width: 240px;
        min-height: 300px;
    }
}

/* ==========================================================
   BLOCK 7: RESPONSIVE BREAKPOINTS & ADJUSTMENTS
   ========================================================== */

/* Large Desktop (1200px and above) */
@media (min-width: 1200px) {
    .search-container {
        gap: 16px;
    }

    .search-input-wrapper {
        min-width: 500px;
    }

    .search-btn,
    .reset-btn,
    .filter-toggle-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .schools-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .view-grid .schools-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .section-title {
        font-size: 2.25rem;
        margin-bottom: 2.5rem;
    }
}

/* Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .schools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .view-grid .schools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Devices (768px - 1023px) */
@media (max-width: 1023px) {
    .explorer-header {
        padding: 1.75rem 1.25rem;
    }

    .explorer-title {
        font-size: 2.25rem;
        margin-bottom: 1.25rem;
    }

    .search-input-wrapper {
        min-width: 350px;
    }

    .search-btn,
    .reset-btn,
    .filter-toggle-btn {
        padding: 12px 18px;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 0 20px 32px;
    }

    .schools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .view-grid .schools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.75rem;
    }

    .school-image {
        height: 180px;
    }
}

/* Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
    .explorer-header {
        padding: 0.5rem 0.5rem !important;
    }

    .search-container {
        height: 48px;
        border-radius: 14px;
    }

    .search-btn,
    .filter-toggle-btn {
        width: 48px !important;
        min-width: 48px !important;
    }

    .search-btn i,
    .filter-toggle-btn i {
        font-size: 1.2rem !important;
    }

    #search {
        padding: 0 14px !important;
        font-size: 15px !important;
    }

    .clear-btn {
        width: 24px;
        height: 24px;
        right: 10px !important;
    }

    .clear-btn i {
        font-size: 0.9rem;
    }

    .filter-badge {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
        top: 6px;
        right: 6px;
        border-width: 2px;
    }

    /* Adjust separator heights */
    .search-btn::after,
    .search-input-wrapper::after {
        height: 20px;
    }

    .main-content {
        padding: 0 12px 20px;
    }

    .schools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .school-image {
        height: 140px;
    }

    .school-info {
        padding: 12px;
    }

    .school-name {
        font-size: 1rem;
        min-height: 2.6em;
    }

    .location {
        font-size: 0.85rem;
    }

    .category {
        font-size: 0.85rem;
        padding: 4px 10px;
    }

    .school-actions {
        flex-direction: column;
        gap: 6px;
    }

    .action-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* MOBILE CAROUSEL GRID */
    .mobile-school-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .carousel-track {
        gap: 15px;
    }

    .category-section {
        margin-bottom: 18px;
        padding: 10px 0;
    }

    /* Even smaller cards for mobile */
    .carousel-track .school-card {
        width: 220px;
        min-height: 280px;
    }

    .mobile-school-grid .school-card {
        min-height: 260px;
    }
}

/* Very Small Devices (360px and below) */
@media (max-width: 360px) {
    .search-container {
        height: 44px;
        border-radius: 12px;
    }

    .search-btn,
    .filter-toggle-btn {
        width: 44px !important;
        min-width: 44px !important;
    }

    .search-btn i,
    .filter-toggle-btn i {
        font-size: 1.1rem !important;
    }

    #search {
        padding: 0 12px !important;
        font-size: 14px !important;
    }

    .filter-badge {
        width: 14px;
        height: 14px;
        font-size: 0.55rem;
        top: 4px;
        right: 4px;
    }

    .search-btn::after,
    .search-input-wrapper::after {
        height: 18px;
    }
}

/* ==========================================================
   BLOCK 8: ACCESSIBILITY & DARK MODE
   ========================================================== */

/* 8-1. ACCESSIBILITY & FOCUS MANAGEMENT */
#search:focus,
.search-btn:focus,
.reset-btn:focus,
.filter-toggle-btn:focus,
.filter-btn:focus,
.filter-select:focus,
.filter-card-close:focus,
.carousel-arrow:focus,
.action-btn:focus,
.school-card:focus-within {
    outline: 2px solid #000080;
    outline-offset: 2px;
}

.action-btn:focus:not(:focus-visible),
.carousel-arrow:focus:not(:focus-visible) {
    outline: none;
}

/* Focus states for unified mobile bar */
@media (max-width: 768px) {
    .search-container:focus-within {
        box-shadow:
            0 4px 25px rgba(50, 135, 255, 0.2),
            inset 0 1px 3px rgba(255, 255, 255, 0.9);
        border-color: rgba(50, 135, 255, 0.6);
    }

    .search-btn:focus,
    .filter-toggle-btn:focus {
        outline: none;
        background: rgba(0, 0, 0, 0.06) !important;
    }
}

/* 8-2. HIGH CONTRAST MODE SUPPORT */
@media (prefers-contrast: high) {
    #search {
        border: 2px solid #000;
    }

    .search-btn,
    .reset-btn,
    .filter-toggle-btn,
    .action-btn {
        border: 2px solid;
    }

    .school-card {
        border: 2px solid #000080;
    }

    .filter-card {
        border: 2px solid #000080;
    }

    .filter-select {
        border-width: 2px;
    }
}

/* 8-3. REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {

    #search,
    .search-btn,
    .reset-btn,
    .filter-toggle-btn,
    .filter-btn,
    .filter-select,
    .filter-card-close,
    .filter-backdrop,
    .school-card,
    .school-card:hover,
    .school-image img,
    .action-btn,
    .carousel-arrow,
    .carousel-track {
        transition: none;
        transform: none;
        animation: none;
    }

    .filter-card {
        transition: none;
    }

    .filter-loading .spinner,
    .carousel-wrapper.loading::after {
        animation: none;
    }
}

/* 8-4. DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {

    /* Explorer Header */
    .explorer-header {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }

    /* Search Input */
    #search {
        background: rgba(45, 55, 72, 0.95);
        color: #f7fafc;
    }

    #search:focus {
        background: #2d3748;
    }

    /* Buttons */
    .reset-btn,
    .filter-toggle-btn {
        background: rgba(45, 55, 72, 0.9);
        color: #cbd5e0;
    }

    .reset-btn:hover,
    .filter-toggle-btn:hover {
        background: #2d3748;
        color: #f7fafc;
    }

    /* Action Buttons */
    .map-btn {
        background: #4692FE;
        border-color: #4692FE;
        box-shadow: 0 2px 8px rgba(70, 146, 254, 0.4);
    }

    .map-btn:hover {
        background: #5ba1ff;
        border-color: #5ba1ff;
        box-shadow: 0 4px 12px rgba(70, 146, 254, 0.5);
    }

    .details-btn {
        background: #1D4B8C;
        border-color: #1D4B8C;
        box-shadow: 0 2px 8px rgba(29, 75, 140, 0.4);
    }

    .details-btn:hover {
        background: #2259a3;
        border-color: #2259a3;
        box-shadow: 0 4px 12px rgba(29, 75, 140, 0.5);
    }

    /* MOBILE DARK MODE - SEGMENTED BAR */
    @media (max-width: 768px) {
        .search-container {
            background: rgba(45, 55, 72, 0.95) !important;
            border-color: rgba(255, 255, 255, 0.15) !important;
            box-shadow:
                0 4px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 2px rgba(255, 255, 255, 0.05) !important;
        }

        .search-btn,
        .filter-toggle-btn {
            color: #cbd5e0 !important;
        }

        .search-btn:hover,
        .filter-toggle-btn:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            color: #f7fafc !important;
        }

        .search-btn:active,
        .filter-toggle-btn:active {
            background: rgba(255, 255, 255, 0.12) !important;
        }

        #search {
            color: #f7fafc !important;
            background: transparent !important;
        }

        #search::placeholder {
            color: #a0aec0 !important;
        }

        .clear-btn {
            background: rgba(255, 255, 255, 0.1) !important;
            color: #cbd5e0 !important;
        }

        .clear-btn:hover {
            background: rgba(255, 255, 255, 0.15) !important;
        }

        /* Dark mode separators */
        .search-btn::after,
        .search-input-wrapper::after {
            background: rgba(255, 255, 255, 0.15) !important;
        }

        .search-container:focus-within {
            box-shadow:
                0 4px 25px rgba(50, 135, 255, 0.25),
                inset 0 1px 3px rgba(255, 255, 255, 0.1);
            border-color: rgba(50, 135, 255, 0.6);
        }

        .filter-badge {
            border-color: rgba(45, 55, 72, 0.95);
        }
    }
}

/* ==========================================================
   BLOCK 9: UTILITY CLASSES & NO SCHOOLS STATES
   ========================================================== */

.no-categories {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    margin: 2rem 0;
}

/* Load More Section */
.load-more-section {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.load-more-btn {
    background: linear-gradient(135deg, #000080 0%, #4a6fff 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 128, 0.3);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* School Modal (if used) */
.school-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    font-family: var(--font-heading);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
}

/* ==========================================================
   END OF HOME.CSS - COMPLETE VERSION
   InovEdu Africa School Directory Homepage
   Organized by HTML blocks for easy maintenance
   ========================================================== */




   /* ==========================================================
   BLOCK 4.6: SCHOOL CARD SELECTION STATES
   ========================================================== */

/* Selected card state */
.school-card.selected {
    border: 3px solid #000080;
    box-shadow: 0 8px 30px rgba(0, 0, 128, 0.25);
    transform: translateY(-4px);
    position: relative;
}

/* Add a subtle glow effect */
.school-card.selected::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 19px; /* Slightly larger than card radius */
    background: linear-gradient(135deg, #000080 0%, #4a6fff 100%);
    z-index: -1;
    opacity: 0.1;
}

/* Selected state with animation */
.school-card.selected {
    animation: cardSelect 0.3s ease-out;
}

@keyframes cardSelect {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 0, 128, 0.08);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 35px rgba(0, 0, 128, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 30px rgba(0, 0, 128, 0.25);
    }
}

/* Focus state for keyboard navigation */
.school-card:focus {
    border: 3px solid #000080;
    box-shadow: 0 8px 30px rgba(0, 0, 128, 0.25);
    transform: translateY(-4px);
    outline: none;
}

/* Hover state for non-selected cards */
.school-card:not(.selected):hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 128, 0.15);
    border-color: rgba(0, 0, 128, 0.2);
}

/* Mobile selected state */
@media (max-width: 768px) {
    .school-card.selected {
        border: 2px solid #000080;
        box-shadow: 0 6px 25px rgba(0, 0, 128, 0.2);
        transform: translateY(-2px);
    }
    
    .school-card:not(.selected):active {
        transform: scale(0.98);
    }
}

/* Optional: Add a selection indicator badge */
.school-card.selected::after {
    content: '✓ Selected';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #000080;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 5;
    animation: fadeIn 0.3s ease-out;
}

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

/* Alternative: Simple border-only selection */
.school-card.selected-simple {
    border: 2px solid #000080;
    box-shadow: 0 4px 20px rgba(0, 0, 128, 0.15);
}

/* Color variations for different selection states */
.school-card.selected-primary {
    border: 3px solid #000080;
    box-shadow: 0 8px 30px rgba(0, 0, 128, 0.25);
}

.school-card.selected-secondary {
    border: 3px solid #4692FE;
    box-shadow: 0 8px 30px rgba(70, 146, 254, 0.25);
}

.school-card.selected-success {
    border: 3px solid #28a745;
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.25);
}

/* ==========================================================
   BLOCK 4.8: SCHOOL STATS & RATINGS STYLING
   ========================================================== */

.school-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 13px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stars {
    display: flex;
    gap: 1px;
}

.rating-value {
    font-weight: 600;
    color: #f39c12;
    font-size: 0.9em;
}

.views, .likes {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 0.9em;
}

.views i {
    color: #3498db;
}

.likes i {
    color: #e74c3c;
}

/* Mobile adjustments for stats */
@media (max-width: 768px) {
    .school-stats {
        font-size: 12px;
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .rating, .views, .likes {
        gap: 3px;
    }
    
    .stars i {
        font-size: 0.7em;
    }
    
    .rating-value {
        font-size: 0.8em;
    }
}

/* Hover effects for interactive stats */
.school-card:hover .likes i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.school-card:hover .rating-value {
    color: #e67e22;
}

/* Optional: Compact stats for smaller cards */
.school-stats.compact {
    font-size: 11px;
    gap: 8px;
}

.school-stats.compact .stars i {
    font-size: 0.7em;
}


/* Mobile Infinite Scroll Styles */
.mobile-load-more-trigger {
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    width: 100%;
}

.mobile-load-more-trigger .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    color: #666;
}

.mobile-load-more-trigger .load-more-prompt {
    padding: 15px;
    color: #888;
    font-style: italic;
    border: 1px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    font-size: 14px;
}

.mobile-load-more-trigger .no-more-results {
    padding: 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
}

/* Mobile-specific spinner */
.mobile-load-more-trigger .spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* Ensure proper school card styling */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 40px;
}

.school-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.school-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .schools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .mobile-load-more-trigger .load-more-prompt {
        font-size: 16px;
        padding: 20px;
    }
}

/* Fix for school card link spacing */
.school-card-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    /* Remove height: 100% - this was causing the white space */
}

/* Ensure school card takes full content height */
.school-card {
    display: flex;
    flex-direction: column;
    height: auto !important; /* Let content determine height */
    min-height: 0 !important;
}

/* Make sure the card content flows naturally */
.school-image {
    flex-shrink: 0; /* Don't shrink the image */
}

.school-info {
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
}

.school-stats {
    margin-top: auto; /* Push stats to bottom */
}

/* Add this to your home.css - preferably at the end */
@media (max-width: 768px) {
    .schools-grid {
        display: grid;
        place-items: center; /* This centers items in grid cells */
        grid-template-columns: minmax(280px, 400px); /* Single column with min/max width */
        justify-content: center; /* Center the grid itself */
    }
    
    .school-card {
        width: 100%;
    }
    
    .mobile-school-grid {
        display: grid;
        place-items: center;
        grid-template-columns: minmax(280px, 400px);
        justify-content: center;
    }
}







/* =======================================================================
   BLOCK 7.2: MOBILE RESPONSIVE ADJUSTMENTS (MAX-WIDTH: 768PX)=======2499
   ======================================================================= */


   /* ==========================================================
   MOBILE CARD ALIGNMENT FIX - Center cards properly
   ========================================================== */

@media (max-width: 768px) {
    /* REMOVE the problematic grid centering */
    .schools-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important; /* Remove auto margin */
        /* REMOVE: place-items: center !important; */
        overflow: hidden !important;
        touch-action: pan-y !important;
    }
    
    /* FIX: Make cards take full grid cell width */
    .school-card {
        width: 100% !important; /* Take full width of grid cell */
        max-width: 100% !important;
        min-width: 0 !important; /* Allow to shrink */
        margin: 0 !important; /* Remove auto margin */
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        will-change: transform !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }
    
    /* FIX: Mobile school grid alignment */
    .mobile-school-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
        touch-action: pan-y !important;
        /* REMOVE: place-items: center !important; */
    }
    
    .mobile-school-grid .school-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    
    /* FIX: Ensure main content has proper alignment */
    .main-content {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        margin-top: 60px !important;
    }
    
    /* FIX: Remove any inherited margins/padding */
    #schools-initial,
    #school-categories-container,
    .schools-grid-initial,
    .category-section {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* FIX: Center the entire section, not individual cards */
    .section-title {
        text-align: center !important;
        padding: 0 16px !important;
        margin: 0 0 16px 0 !important;
        width: 100% !important;
    }
}

/* ==========================================================
   SPECIFIC FIX FOR DIFFERENT SCREEN SIZES
   ========================================================== */

/* Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
    .schools-grid {
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .school-card {
        width: 100% !important;
    }
    
    .mobile-school-grid {
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .mobile-school-grid .school-card {
        width: 100% !important;
    }
    
    .section-title {
        padding: 0 12px !important;
    }
}

/* Very Small Devices (360px and below) */
@media (max-width: 360px) {
    .schools-grid {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .school-card {
        width: 100% !important;
    }
    
    .mobile-school-grid {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .mobile-school-grid .school-card {
        width: 100% !important;
    }
    
    .section-title {
        padding: 0px 10px !important;
    }
}

/* ==========================================================
   NUCLEAR OPTION - Force perfect centering
   ========================================================== */

/* If the above doesn't work, try this nuclear option */
@media (max-width: 768px) {
    /* Reset everything */
    .schools-grid,
    .mobile-school-grid {
        all: unset !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding: 16px !important;
        gap: 16px !important;
        box-sizing: border-box !important;
    }
    
    .school-card,
    .mobile-school-grid .school-card {
        all: unset !important;
        display: block !important;
        width: 100% !important;
        max-width: 400px !important;
        background: white !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure the card structure is preserved */
    .school-card .school-image,
    .school-card .school-info {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}
