/* =========================================================
   Namugongo Model Primary School — Stylesheet
   Theme: Dark navy background, sky-blue headers/nav, white text
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Open+Sans:wght@400;600;700&display=swap');

:root {
    color-scheme: dark;

    /* Background */
    --bg: #071427;               /* dark navy blue */
    --bg-alt: #0b1e3a;           /* slightly lighter navy for section stripes */
    --surface: #0e2547;          /* card surface */
    --surface-strong: #12305c;   /* elevated card surface */

    /* Sky blue accents (headers / navbars / buttons) */
    --sky: #38bdf8;
    --sky-strong: #0ea5e9;
    --sky-soft: rgba(56, 189, 248, 0.16);

    --text: #ffffff;
    --muted: #c3d4ee;
    --border: rgba(148, 197, 255, 0.16);
    --radius: 18px;
    --shadow: 0 18px 40px rgba(2, 9, 23, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    display: flex;
    min-height: 100vh;
    font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #ffffff;
}

a { color: var(--sky); }
img { max-width: 100%; display: block; }

.container { width: min(1180px, 94%); margin: 0 auto; }

/* ---------------- Sidebar / Nav (sky blue) ---------------- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 270px;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: linear-gradient(180deg, var(--sky-strong) 0%, #0369a1 55%, #075985 100%);
    box-shadow: 6px 0 30px rgba(2, 9, 23, 0.5);
    transform: translateX(0);
    transition: transform 0.28s ease;
    z-index: 30;
    overflow-y: auto;
}

.sidebar .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    padding: 0;
}

.sidebar .brand-wrap { flex-direction: column; align-items: flex-start; gap: 12px; }

.logo-badge {
    width: 62px; height: 62px;
    border-radius: 50%;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
    border: 2px solid rgba(255,255,255,0.6);
}
.logo-badge img { width: 100%; height: 100%; object-fit: cover; }

.brand {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.sidebar .nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    width: 100%;
}

.sidebar .nav-links a {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar .nav-links a:hover,
.sidebar .nav-links a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar-contact {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.25);
    font-size: 0.8rem;
    color: #eaf6ff;
}
.sidebar-contact p { margin-bottom: 6px; }

.sidebar-toggler {
    position: fixed;
    top: 18px; left: 18px;
    width: 42px; height: 42px;
    border: none;
    border-radius: 12px;
    background: var(--sky-strong);
    color: #fff;
    font-size: 1.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 40;
    box-shadow: 0 14px 30px rgba(0,0,0,0.3);
}
.sidebar-toggler:focus { outline: 2px solid #fff; }

/* ---------------- Main layout ---------------- */
.main-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
    background: var(--bg);
}

/* Page hero header band — sky blue */
.page-hero {
    background: linear-gradient(120deg, var(--sky-strong), #0369a1);
    color: #fff;
    padding: 54px 40px;
    box-shadow: var(--shadow);
}
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-hero p { color: #eaf6ff; max-width: 720px; margin-top: 10px; }

.hero {
    min-height: 62vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(120deg, rgba(3, 105, 161, 0.92), rgba(7, 20, 39, 0.94)),
        url('images/pipils.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 60px 40px;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 34px; align-items: center; }
.hero-content { max-width: 620px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.15; margin-bottom: 16px; color: #fff; }
.hero p { margin-bottom: 24px; font-size: 1rem; color: #eaf6ff; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-image {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 3px solid rgba(255,255,255,0.25);
}

.btn {
    display: inline-block;
    background: var(--sky);
    color: #04223f;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 999px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.35);
}
.btn:hover { transform: translateY(-2px); background: #7dd3fc; }
.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid var(--sky);
    box-shadow: none;
}
.btn-outline:hover { background: var(--sky-soft); }

/* ---------------- Sections ---------------- */
.section { padding: 60px 40px; }
.section:nth-of-type(even) { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 10px; }
.section-intro { color: var(--muted); max-width: 760px; margin-bottom: 34px; font-size: 0.98rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }

.card, .image-card, .news-item, .form-card, .table-card, .highlight-panel, .dashboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.image-card img, .news-item img { border-radius: 12px; margin-bottom: 14px; height: 190px; width: 100%; object-fit: cover; }
.image-card h3, .news-item h3 { color: var(--sky); margin-bottom: 8px; }
.image-card p, .news-item p, .card p { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-top: 44px; }
.stat { text-align: center; background: var(--surface-strong); border-radius: var(--radius); padding: 26px 14px; border: 1px solid var(--border); }
.stat-number { font-size: 2.1rem; color: var(--sky); }
.stat p { color: var(--muted); margin-top: 6px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.gallery img { border-radius: var(--radius); height: 200px; width: 100%; object-fit: cover; box-shadow: var(--shadow); transition: transform 0.25s ease; }
.gallery img:hover { transform: scale(1.03); }

.highlight-panel {
    margin-top: 34px;
    background: linear-gradient(120deg, var(--surface-strong), var(--surface));
    border-left: 4px solid var(--sky);
}
.highlight-panel h3 { color: var(--sky); margin-bottom: 8px; }
.highlight-panel p { color: var(--muted); }

/* ---------------- Forms ---------------- */
.form-card { margin-top: 20px; max-width: 720px; }
.form-card h3 { color: var(--sky); margin-bottom: 16px; }
form { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; margin-top: 12px; color: #dceaff; font-size: 0.88rem; }
input, textarea, select {
    background: #08182f;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-soft); }
textarea { min-height: 120px; resize: vertical; }
form .btn { margin-top: 18px; align-self: flex-start; }

.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.notice-success { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.35); }
.notice-error { background: rgba(248, 113, 113, 0.15); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.35); }

/* ---------------- Tables / Dashboard ---------------- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.dashboard-card { text-align: center; border-top: 4px solid var(--sky); }
.dashboard-card h3 { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.dashboard-number { font-size: 2.4rem; color: var(--sky); font-weight: 800; margin: 8px 0; }

.table-card { margin-top: 24px; overflow-x: auto; }
.table-card h3 { color: var(--sky); margin-bottom: 14px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.data-table th { color: var(--sky); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; }
.data-table tr:hover td { background: rgba(56, 189, 248, 0.06); }

/* ---------------- Footer ---------------- */
footer {
    background: #04101f;
    padding: 46px 40px 20px;
    border-top: 1px solid var(--border);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding-bottom: 26px; }
.footer-tagline { color: var(--sky); margin-top: 10px; font-weight: 600; }
footer h4 { color: var(--sky); margin-bottom: 12px; font-size: 0.95rem; }
.footer-links { list-style: none; color: var(--muted); display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--sky); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; text-align: center; color: var(--muted); font-size: 0.8rem; }

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.show { opacity: 1; transform: translateY(0); }

/* =========================================================
   Nexa AI Assistant Widget
   ========================================================= */
.nexa-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    width: 62px; height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sky), var(--sky-strong));
    border: none;
    color: #04223f;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(14, 165, 233, 0.45);
    animation: nexa-pulse 2.6s infinite;
}
@keyframes nexa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.55); }
    70% { box-shadow: 0 0 0 16px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.nexa-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 340px;
    max-width: 92vw;
    height: 460px;
    max-height: 72vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
}
.nexa-panel.open { display: flex; }

.nexa-header {
    background: linear-gradient(120deg, var(--sky-strong), #0369a1);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nexa-header-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.95rem; }
.nexa-header-title .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.nexa-close { background: none; border: none; color: #fff; font-size: 1.1rem; cursor: pointer; }

.nexa-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg);
}
.nexa-msg { max-width: 85%; padding: 10px 13px; border-radius: 12px; font-size: 0.85rem; line-height: 1.45; }
.nexa-msg.bot { align-self: flex-start; background: var(--surface-strong); color: #eaf6ff; border-bottom-left-radius: 2px; }
.nexa-msg.user { align-self: flex-end; background: var(--sky); color: #04223f; font-weight: 600; border-bottom-right-radius: 2px; }

.nexa-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--bg); }
.nexa-chip {
    background: var(--sky-soft);
    color: var(--sky);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    cursor: pointer;
}
.nexa-chip:hover { background: var(--sky); color: #04223f; }

.nexa-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.nexa-input-row input {
    flex: 1;
    background: #08182f;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.85rem;
}
.nexa-send {
    background: var(--sky);
    color: #04223f;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .sidebar-toggler { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .page-hero, .section, .hero { padding-left: 22px; padding-right: 22px; }
    .nexa-panel { right: 12px; bottom: 88px; }
    .nexa-launcher { right: 16px; bottom: 16px; }
}
