/* ========================
    Modern School Filters
=========================== */

.body {
    padding: 80px 20px 100px 0px;
    background: #fff;
    box-sizing: border-box;
}

.main-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px 40px;
    min-height: 80vh;
    background: rgba(0, 0, 0, 0);
    margin-top: 90px;
}

.modern-filter-sidebar {
    background: rgba(0, 0, 0, 0);
    border-radius: 15px;
    padding: 14px 20px 20px 20px;
    min-width: 285px;
    max-width: 350px;
    margin-bottom: 36px;
    font-size: 1rem;
    border: none;
    flex-shrink: 0;
    width: 320px;
}

.offcanvas-sidebar-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 10px;
}
.offcanvas-sidebar-block {
    background: #dbece4;
    border-radius: 6px;
    margin-bottom: 20px;
    padding: 18px 16px 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.offcanvas-sidebar-block__title {
    font-weight: 600;
    color: #21244b;
    margin-bottom: 9px;
    font-size: 1rem;
}
.filter-search-bar .fa-search {
    position: absolute;
    left: 14px;
    top: 10px;
    color: #33b273;
    font-size: 1.2rem;
}
.filter-search-bar input[type="text"] {
    padding-left: 38px;
    background: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;

}
.see-more-btn {
    background: none;
    border: none;
    color: #26b174;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    padding: 0;
    margin: 6px 0 2px 0;
    text-decoration: underline;
}
.offcanvas-sidebar-list li label {
    font-weight: 400;
    color: #444;
    font-size: 0.98rem;
    cursor: pointer;
}
.offcanvas-sidebar-list input[type="checkbox"] {
    accent-color: #26b174;
    margin-right: 6px;
}
.offcanvas-sidebar-list {
    max-height: 160px;
    overflow: hidden;
    transition: max-height 0.25s;
}
.offcanvas-sidebar-list.expanded {
    max-height: 420px;
    overflow-y: auto;
}
@media (min-width: 900px) {
    .modern-filter-sidebar {
        position: sticky;
        top: 0px;  /* Adjust to match your header height if needed */
        align-self: flex-start;
        z-index: 2;
    }
}

/* ===============================
    Directory Content Card Styles
================================== */
.directory-content-card {
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 4px 32px 0 #d1dbed40;
    padding: 32px 36px 20px 36px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ===============================
    Result Bar & Grid/List Toggle
================================== */
.result-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    margin-top: 0;
    padding: 0 2px;
    background: transparent;
}

/* === Result Bar Bordered Box === */
.result-bar-row.result-bar-bordered {
    border: 1.5px solid #e4e7ed;
    border-radius: 12px;
    background: #fff;
    padding: 12px 22px 12px 18px;
    margin-bottom: 22px;
    margin-top: 0;
    box-shadow: 0 2px 8px 0 #e9eefb33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 50px;
}

.offers-control__results {
    font-size: 1.08rem;
    color: #535364;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ==== Layout Switcher Buttons ==== */
.layout-switch-group {
    display: flex;
    align-items: center;
    gap: 2px;
}
.layout-switcher-btn {
    border: none;
    background: transparent;
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.16s, box-shadow 0.16s;
    outline: none;
    margin-left: 0;
}

.layout-switcher-btn svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: #b3b3b3;
    transition: fill 0.16s;
}
.layout-switcher-btn.active, .layout-switcher-btn:focus {
    background: #e2fff2;
    box-shadow: 0 2px 7px 0 #26b17422;
}
.layout-switcher-btn.active svg, .layout-switcher-btn:focus svg {
    fill: #21b172;
}
.layout-switcher-btn:not(.active):hover svg {
    fill: #40c490;
}

/* Responsive: compress the row on small screens */
@media (max-width: 700px) {
    .result-bar-row.result-bar-bordered {
        flex-direction: column;
        align-items: flex-start;
        padding: 9px 6px 9px 10px;
        gap: 10px;
    }
    .offers-control__results { font-size: 0.99rem; }
}

/* Utility: fix some possible overflow */
.directory-content-card,
.main-container {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* =============== Responsive =============== */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        padding: 20px 6px 24px 6px;
        gap: 16px;
    }
    .modern-filter-sidebar {
        width: 100%;
        max-width: 100%;
        min-width: unset;
        margin-bottom: 0;
        padding: 16px 8px 16px 8px;
        border-radius: 12px;
    }
    .directory-content-card {
        padding: 18px 10px 10px 10px;
        border-radius: 12px;
    }
}
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        padding: 10px 2px 10px 2px;
        margin-top: 60px;
        gap: 10px;
    }
    .modern-filter-sidebar {
        padding: 10px 2px 10px 2px;
        border-radius: 10px;
    }
    .directory-content-card { padding: 10px 2px 8px 2px; border-radius: 10px;}
}
@media (max-width: 480px) {
    .result-bar-row { flex-direction: column; gap: 8px; padding: 0;}
    .list-grid-btn { padding: 7px 8px; font-size: 1rem;}
    .offers-control__results { font-size: 0.97rem;}
    .offcanvas-sidebar-block { padding: 10px 8px 8px 8px; border-radius: 8px;}
    .offcanvas-sidebar-block__title { font-size: 0.97rem; margin-bottom: 7px;}
    .filter-search-bar .fa-search { left: 7px; top: 11px; font-size: 1rem;}
    .filter-search-bar input[type="text"] { font-size: 0.95rem; padding-left: 28px;}
    .price-slider-row input[type="number"] { font-size: 0.92rem;}
    .see-more-btn { font-size: 0.93rem;}
}

/*==================================== 
        Modern Pagination
====================================*/
.custom-pagination ul {
    display: flex;
    list-style: none;
    padding-left: 0;
    gap: 5px;
    margin: 16px 0;
    justify-content: flex-end; /* This aligns pagination to the right */
}

.custom-pagination li {
    display: inline-block;
}

.custom-pagination a, .custom-pagination span {
    display: inline-block;
    min-width: 32px;
    padding: 7px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: #fff;
    color: #2e2e2e;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
}

.custom-pagination li.active span,
.custom-pagination li.active a {
    background: #26ba64;
    color: #fff;
    border-color: #26ba64;
    pointer-events: none;
}

.custom-pagination li.disabled a,
.custom-pagination li.disabled span {
    background: #f2f2f2;
    color: #aaa;
    cursor: default;
    pointer-events: none;
}

.custom-pagination a:hover {
    background: #e6f5ea;
    color: #26ba64;
    border-color: #26ba64;
}

/*==================================== 
    Modern School Card - 4 Per Row Grid 
====================================*/

.school-cards-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 15px;
    justify-items: stretch;
    align-items: stretch;
    max-width: 1300px;      /* Or 1200px for even tighter look */
    margin: 0 auto 40px auto; /* Center block horizontally, spacing below */
    padding: 0 10px;        /* Optional: padding for edge on mobile */
}

/* Remove old flex settings for .school-card */
.school-card {
    position: relative;
    background: #f8f8fc;
    border-radius: 22px;
    box-shadow: 0 6px 32px 0 #c7d6e81a;
    padding: 0;
    overflow: hidden;
    border: 1.5px solid #f2f2f2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 390px;
    /* max-width removed for grid - full width in grid cell */
    width: 100%;
    transition: box-shadow 0.18s, border-color 0.2s;
    margin: 0; /* Grid handles spacing */
}

.school-card:hover {
    border-color: #26b17488;
    box-shadow: 0 12px 40px 0 #26b17423;
}

.school-card .logo-link {
    display: block;
    background: #cbdcd4 url('/uploads/frontend/images/school_card2.png') center center no-repeat;
    background-size: cover;
    padding: 34px 0 18px 0;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    text-align: center;
    /* Add any extra styling here */
}

.school-card .logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    border-radius: 16px;
    background: #f3f6fb;
    transition: transform 0.14s;
}

.school-card .logo-link:hover .logo {
    transform: scale(1.06);
}

.school-card .info-box {
    background: #fff;
    padding: 10px 20px 12px 20px;
    border-radius: 0 0 22px 22px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.school-card .name-link {
    color: #22264c;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    margin: 0 0 2px 0;
    display: inline-block;
    text-align: left;
    transition: color 0.14s;
}

.school-card .name-link:hover {
    color: #26b174;
}

.school-card .location-row {
    margin-bottom: 13px;
    color: #21244b;
    font-weight: 500;
    font-size: 1.08rem;
    display: block;
}

.school-card .stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 10px;
}

.school-card .stat-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.school-card .stat-label {
    color: #353753;
    font-size: 1.04rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.school-card .stat-value {
    font-size: 1.16rem;
    font-weight: 700;
    color: #22264c;
    line-height: 1.1;
}

.school-card .region-box {
    background: #f8fafb;
    border: 2px solid #dfdff7;
    border-radius: 10px;
    padding: 8px 24px;
    color: #444;
    font-size: 1.04rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.school-card .divider {
    margin: 15px 0 15px 0;
    border: none;
    border-bottom: 2px solid #dfdff7;
    width: 100%;
}

.school-card .footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #d73333;
    font-size: 1.06rem;
    font-weight: 600;
}

.school-card .students {
    display: flex;
    align-items: center;
    color: #ff4343;
    font-weight: 700;
    font-size: 1.13rem;
}

.school-card .students i {
    font-size: 1.1rem;
    margin-right: 4px;
}

.school-card .added-when {
    color: #757680;
    font-weight: 500;
    font-size: 1.04rem;
}

/* =============================
    RESPONSIVE BREAKPOINTS 
============================= */
@media (max-width: 1400px) {
    .school-cards-wrap {
        grid-template-columns: repeat(3, 1fr); /* 3 per row */
    }
}
@media (max-width: 900px) {
    .school-cards-wrap {
        grid-template-columns: repeat(2, 1fr); /* 2 per row */
    }
}
@media (max-width: 600px) {
    .school-cards-wrap {
        grid-template-columns: 1fr; /* 1 per row */
    }
    .school-card { min-height: unset; width: 100%; }
    .school-card .info-box { padding: 16px 10px 0 10px; }
    .school-card .region-box { min-width: 0; font-size: 0.97rem; padding: 6px 12px; }
}
@media (max-width: 400px) {
    .school-card .logo { width: 48px; height: 48px; }
    .school-card .info-box { padding: 8px 4px 0 4px; }
}
