/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: #fafafa; /* Lighter clean background */
    color: #333333; /* Dark text for readability */
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── Navbar (public pages) ── */
.navbar {
    background: #ffffff; /* White navbar */
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eeeeee;
}
.nav-brand { font-size: 1.3rem; font-weight: 700; color: #f11c5c; } /* Pink brand */
.nav-links a {
    color: #555555;
    margin-left: 24px;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: #f11c5c; } /* Pink hover */

/* ── Main container (public) ── */
.main-container { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: #f11c5c; /* Solid Pink background */
    color: #fff;
    border-radius: 16px;
    margin-bottom: 40px;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 12px; }
.hero p  { font-size: 1.1rem; color: #ffe6eb; margin-bottom: 24px; }
.search-bar {
    width: 100%;
    max-width: 480px;
    padding: 12px 20px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    outline: none;
}

/* ── Schools grid ── */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.school-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    border: 1px solid #eeeeee;
}
.school-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(241,28,92,0.12); } /* Subtle pink shadow on hover */
.school-logo { height: 120px; background: #fff4f6; display:flex; align-items:center; justify-content:center; }
.school-logo img { max-height: 100%; object-fit: contain; }
.logo-placeholder { font-size: 2.5rem; font-weight: 700; color: #f11c5c; }
.school-info { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.school-info h2 { font-size: 1.1rem; }
.school-info .city { color: #666; font-size: 0.9rem; }
.stats-row { display: flex; gap: 16px; }
.stats-row .stat { background: #fafafa; padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; border: 1px solid #eee; }
.stats-row .stat strong { color: #f11c5c; }

/* ── School detail ── */
.school-detail { max-width: 900px; margin: 0 auto; }
.school-header { background:#fff; border-radius:14px; padding:32px; margin-bottom:24px; box-shadow:0 2px 12px rgba(0,0,0,0.04); border: 1px solid #eee; }
.school-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.stat-card-public { background:#fff; border-radius:14px; padding:28px; text-align:center; box-shadow:0 2px 12px rgba(0,0,0,0.04); border: 1px solid #eee; }
.stat-card-public h3 { font-size: 2.5rem; color: #f11c5c; margin-bottom: 6px; }
.progress-bar { background:#e9ecef; border-radius:50px; height:10px; margin:12px 0 6px; overflow:hidden; }
.progress { background: #f11c5c; height:100%; border-radius:50px; transition:width 0.6s; }
.contact-info { background:#fff; border-radius:14px; padding:24px; margin-bottom:24px; box-shadow:0 2px 12px rgba(0,0,0,0.04); border: 1px solid #eee; }
.contact-info p { margin-bottom: 8px; font-size: 0.95rem; }

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: #f11c5c; color: #fff; } /* Pink buttons */
.btn-danger  { background: #e63946; color: #fff; }
.btn-success { background: #2dc653; color: #fff; }
.btn-full    { width: 100%; text-align: center; padding: 14px; font-size: 1rem; }
.btn-sm      { padding: 6px 14px; font-size: 0.82rem; }

/* ── Auth pages (login) ── */
.auth-page {
    background: #fafafa; /* Clean background for auth */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); /* Lighter shadow */
    border: 1px solid #eee;
    text-align: center;
}
.auth-logo { font-size: 3rem; margin-bottom: 12px; color: #f11c5c; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; color: #333; }
.auth-sub { color: #888; font-size: 0.9rem; margin-bottom: 28px; }
.auth-footer { margin-top: 20px; font-size: 0.88rem; color: #888; }
.auth-footer a { color: #f11c5c; }

/* ── Form groups ── */
.form-group { text-align: left; margin-bottom: 18px; }
.form-group label { display:block; font-size:0.88rem; font-weight:600; margin-bottom:6px; color:#444; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fafafa;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f11c5c; /* Pink focus border */
    background: #fff;
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* ── Alerts ── */
.alert { padding:12px 16px; border-radius:8px; margin-bottom:18px; font-size:0.9rem; }
.alert-error   { background:#fff0f0; color:#c0392b; border:1px solid #f5c6cb; }
.alert-success { background:#f0fff4; color:#1a7a3f; border:1px solid #c3e6cb; }

/* ── Admin layout (sidebar) ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 240px;
    background: #ffffff; /* White sidebar */
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    border-right: 1px solid #eeeeee;
}
.sidebar-brand {
    padding: 22px 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f11c5c; /* Pink brand */
    border-bottom: 1px solid #eeeeee;
}
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-nav a {
    display: block;
    padding: 12px 22px;
    color: #666666; /* Dark grey links */
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #fff0f4; /* Light pink hover */
    color: #f11c5c;
    border-left: 3px solid #f11c5c;
}
.sidebar-nav .logout-link { color: #e63946; margin-top: auto; }
.sidebar-user {
    padding: 16px 20px;
    font-size: 0.82rem;
    color: #888;
    border-top: 1px solid #eeeeee;
}

/* ── Admin main content ── */
.admin-main {
    margin-left: 240px;
    flex: 1;
    padding: 28px 32px;
    min-height: 100vh;
    background: #fafafa;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.admin-header h1 { font-size: 1.6rem; color: #333; }
.admin-header span { color: #888; font-size: 0.9rem; }

/* ── Stat cards (admin dashboard) ── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
    background: #ffffff; /* White stat cards */
    border: 1px solid #eeeeee;
    border-radius: 14px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #333333;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
}
/* Overriding the old gradient classes to be uniform pink/white style */
.stat-card.blue, .stat-card.green, .stat-card.purple, .stat-card.orange { 
    background: #ffffff; 
}
.stat-icon { font-size: 2rem; color: #f11c5c; }
.stat-info h2 { font-size: 2rem; line-height: 1; color: #f11c5c; } /* Pink numbers */
.stat-info p  { font-size: 0.85rem; color: #888; margin-top: 4px; }

/* ── Admin card (tables) ── */
.admin-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    border: 1px solid #eeeeee;
    margin-bottom: 28px;
    overflow: hidden;
}
.card-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}
.card-header h3 { font-size: 1rem; color: #333; }

/* ── Admin table ── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.82rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-table td { padding: 13px 16px; border-top: 1px solid #f0f0f0; font-size: 0.9rem; }
.admin-table tr:hover td { background: #fff4f6; } /* Light pink on hover row */

/* ── Badges ── */
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:0.78rem; font-weight:600; }
.badge-success { background:#e8f5e9; color:#2e7d32; }
.badge-danger  { background:#ffebee; color:#c62828; }
.badge-warning { background:#fff8e1; color:#f57f17; }

/* ── Footer ── */
.footer { text-align:center; padding:20px; color:#aaa; font-size:0.85rem; border-top:1px solid #e9ecef; margin-top:40px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .admin-main { margin-left: 0; padding: 16px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .schools-grid { grid-template-columns: 1fr; }
}
/* ── Form grid (2 columns) ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* ── Custom PNG Icon Placeholders ── */
.custom-png-icon {
    width: 24px;   
    height: 24px;
    object-fit: contain;
    display: inline-block;
}

.stat-icon .custom-png-icon {
    width: 40px;
    height: 40px;
}
/* Update your sidebar brand class */
.sidebar-brand {
    padding: 22px 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f11c5c; 
    border-bottom: 1px solid #eeeeee;
    display: flex;             /* Align logo and text */
    align-items: center;       /* Center them vertically */
    gap: 10px;                 /* Space between logo and text */
}

/* Update your sidebar links class */
.sidebar-nav a {
    display: flex;             /* Align icon and text */
    align-items: center;       /* Center them vertically */
    gap: 12px;                 /* Space between icon and text */
    padding: 12px 22px;
    color: #666666; 
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s;
}
/* Force all sidebar navigation icons to be small */
.sidebar-nav a img {
    width: 20px;       /* Change this number to make them bigger or smaller */
    height: 20px;
    object-fit: contain;
    display: inline-block;
    flex-shrink: 0;    /* Prevents the icon from getting squished */
}
/* Adjust the top left brand logo */
.sidebar-brand img {
    width: 208px; 
    height: 80px;
    object-fit: contain;
}
/* Admin Dashboard Stat Card Icons */
.stat-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain; /* Prevents stretching */
    display: block;
}
/* Admin Sidebar Brand Logo */
.admin-brand-logo {
    height: 70px; /* Adjust this to make your logo bigger or smaller */
    width: auto;
    object-fit: contain;
    display: block;
}


/* ═══════════════════════════════════════
   MOBILE & TABLET RESPONSIVE - ALL PUBLIC PAGES
   ═══════════════════════════════════════ */

/* ── Navbar mobile fix ── */
@media (max-width: 768px) {

    /* Navbar */
    .top-nav {
        padding: 0 14px !important;
        height: 58px !important;
        flex-wrap: nowrap !important;
    }
    .nav-brand img {
        height: 34px !important;
    }
    .nav-links {
        gap: 2px !important;
    }
    .nav-links a {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
    }

    /* Hide middle nav links on small screens, keep Login */
    .nav-links a:not(.btn-pink-nav-wrap):not([href*="index"]) {
        display: none !important;
    }

    /* Show hamburger menu instead */
    .nav-mobile-menu-btn {
        display: flex !important;
    }

    /* Login dropdown */
    .btn-pink-nav {
        padding: 7px 14px !important;
        font-size: 0.78rem !important;
    }
    .login-menu {
        right: 0 !important;
        min-width: 200px !important;
    }

    /* Hero sections */
    .page-hero,
    .about-hero,
    .contact-hero {
        padding: 40px 16px 60px !important;
    }
    .page-hero h1,
    .about-hero h1,
    .contact-hero h1 {
        font-size: 1.7rem !important;
    }
    .page-hero p,
    .about-hero p,
    .contact-hero p {
        font-size: 0.9rem !important;
    }

    /* Hero search bar */
    .hero-search input {
        font-size: 0.88rem !important;
        padding: 12px 16px 12px 44px !important;
    }

    /* Stats bar */
    .stats-bar { padding: 0 !important; }
    .stats-bar-inner {
        flex-wrap: wrap !important;
        gap: 0 !important;
    }
    .stats-bar-item {
        flex: 1 1 33% !important;
        padding: 14px 12px !important;
        min-width: 0 !important;
        justify-content: center !important;
    }
    .stats-bar-num { font-size: 1.2rem !important; }
    .stats-bar-lbl { font-size: 0.7rem !important; }
    .stats-bar-icon {
        width: 36px !important;
        height: 36px !important;
        display: none !important;
    }

    /* Schools grid */
    .schools-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 0 !important;
    }

    /* Public main container */
    .pub-main {
        padding: 20px 14px 40px !important;
    }
    .section-header h2 { font-size: 1.1rem !important; }
    .section-header span { font-size: 0.78rem !important; }

    /* School detail hero */
    .school-hero {
        padding: 28px 16px 50px !important;
    }
    .school-hero-inner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    .school-hero-logo {
        width: 68px !important;
        height: 68px !important;
        border-radius: 14px !important;
        transform: none !important;
    }
    .school-hero-info h1 {
        font-size: 1.4rem !important;
    }
    .hero-meta {
        gap: 8px !important;
        flex-wrap: wrap !important;
    }
    .hero-meta span {
        font-size: 0.75rem !important;
        padding: 3px 8px !important;
    }
    .school-hero-action {
        width: 100% !important;
    }
    .btn-apply-hero {
        width: 100% !important;
        text-align: center !important;
        padding: 12px !important;
        font-size: 0.9rem !important;
    }

    /* School content */
    .school-content {
        padding: 20px 14px 40px !important;
    }

    /* Two col becomes one col */
    .two-col {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* School overview stats table */
    /* Row 1: 4 cols → 2x2 */
    .school-content .s-card [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }
    /* Row 2: 3 cols → 1 col stacked */
    .school-content .s-card [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Teacher chips */
    .teacher-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .teacher-chip {
        padding: 10px 10px !important;
    }

    /* Apply CTA */
    .apply-cta {
        padding: 28px 16px !important;
        border-radius: 14px !important;
    }
    .apply-cta h2 { font-size: 1.2rem !important; }
    .btn-apply-cta {
        padding: 12px 24px !important;
        font-size: 0.9rem !important;
    }

    /* Apply page */
    .apply-page {
        grid-template-columns: 1fr !important;
        padding: 20px 14px 40px !important;
        gap: 20px !important;
    }
    .apply-info { position: static !important; }
    .apply-form-card { padding: 20px 16px !important; }
    .form-row { grid-template-columns: 1fr !important; }

    /* About page */
    .about-content {
        padding: 24px 14px 40px !important;
    }
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .stats-strip {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    .about-main { padding: 20px 16px !important; }
    .mission-strip { padding: 24px 16px !important; }

    /* Contact page */
    .contact-content {
        grid-template-columns: 1fr !important;
        padding: 20px 14px 40px !important;
        gap: 16px !important;
    }
    .contact-info-panel { position: static !important; }
    .contact-form-card { padding: 20px 16px !important; }

    /* IS Posts */
    .posts-content { padding: 24px 14px 40px !important; }
    .posts-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Notifications */
    .notif-content { padding: 24px 14px 40px !important; }
    .notif-item { padding: 16px !important; }
    .notif-top { flex-wrap: wrap !important; gap: 8px !important; }
    .notif-footer { gap: 10px !important; flex-wrap: wrap !important; }
    .filter-bar { gap: 6px !important; }
    .filter-btn {
        padding: 5px 12px !important;
        font-size: 0.78rem !important;
    }

    /* Modal */
    .modal-overlay { padding: 12px !important; }
    .modal-box { border-radius: 14px !important; max-height: 95vh !important; }
    .modal-body { padding: 18px 16px !important; }
    .modal-title { font-size: 1.15rem !important; }

    /* Footer */
    .pub-footer { padding: 18px 16px !important; font-size: 0.78rem !important; }
}

/* ── Extra small phones (under 480px) ── */
@media (max-width: 480px) {
    .top-nav { padding: 0 12px !important; }
    .nav-brand img { height: 30px !important; }

    .hero { padding: 40px 14px 50px !important; }
    .hero h1 { font-size: 1.6rem !important; }

    .school-hero-info h1 { font-size: 1.2rem !important; }

    .stats-bar-item { flex: 1 1 100% !important; border-right: none !important; border-bottom: 1px solid #f0f0f0; }

    .about-grid { grid-template-columns: 1fr !important; }
    .stats-strip { grid-template-columns: 1fr 1fr !important; }

    .teacher-grid { grid-template-columns: 1fr !important; }

    /* School overview — all single column on tiny screens */
    .school-content .s-card [style*="grid-template-columns:repeat(4,1fr)"],
    .school-content .s-card [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ── Tablet (768px - 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .top-nav { padding: 0 20px !important; }
    .nav-links a {
        padding: 7px 10px !important;
        font-size: 0.8rem !important;
    }

    .schools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pub-main { padding: 28px 20px 50px !important; }

    .school-content {
        grid-template-columns: 1fr !important;
        padding: 24px 20px 50px !important;
    }

    .two-col { grid-template-columns: 1fr 1fr !important; }

    .about-grid { grid-template-columns: 1fr 1fr !important; }
    .stats-strip { grid-template-columns: repeat(3, 1fr) !important; }

    .contact-content { grid-template-columns: 1fr !important; }
    .apply-page { grid-template-columns: 1fr !important; }

    .posts-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Logo size fix for all public pages ── */
.top-nav .nav-brand img,
.pub-nav .nav-brand img {
    height: 105px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Make navbar slightly taller to fit bigger logo */
.top-nav,
.pub-nav {
    height: 105px !important;
}