/* =========================================================
   KPS Portal — Glass Design System
   Palette pulled from the KPS star-and-book emblem.
   Two glass registers:
     - "ink glass"   : dark, translucent, on the navy mesh (header/sidebar/hero/footer)
     - "frost glass" : light, translucent, sits on top of the mesh (content cards)
   Signature motif: the emblem's eight-point star, reused as a
   quiet recurring mark (nav bullets, section dividers, card corners).
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@700;800;900&display=swap');

:root {
    --ink-950: #060b22;
    --ink-900: #0c163f;
    --navy-800: #142a6e;
    --blue-700: #1e40af;
    --blue-600: #2b52c9;
    --blue-400: #5f8bf2;
    --blue-200: #bcd2ff;
    --star-gold: #eef2ff;

    --frost-bg: rgba(255, 255, 255, 0.72);
    --frost-bg-strong: rgba(255, 255, 255, 0.86);
    --frost-border: rgba(255, 255, 255, 0.55);

    --ink-glass-bg: rgba(255, 255, 255, 0.08);
    --ink-glass-bg-strong: rgba(255, 255, 255, 0.14);
    --ink-glass-border: rgba(255, 255, 255, 0.22);

    --text-on-dark: #eef2ff;
    --text-on-dark-dim: #a9b8e8;
    --text-on-light: #1b2450;
    --text-on-light-dim: #4c5878;

    --shadow-soft: 0 20px 45px rgba(6, 11, 34, 0.35);
    --shadow-lift: 0 26px 55px rgba(6, 11, 34, 0.45);

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--text-on-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background-color: var(--ink-950);
    background-image:
        radial-gradient(circle at 18% 15%, rgba(95, 139, 242, 0.35), transparent 42%),
        radial-gradient(circle at 88% 8%, rgba(43, 82, 201, 0.40), transparent 46%),
        radial-gradient(circle at 60% 95%, rgba(20, 42, 110, 0.55), transparent 55%),
        linear-gradient(160deg, #060b22 0%, #0c163f 45%, #142a6e 100%);
    background-attachment: fixed;
    background-size: cover;
    position: relative;
}

/* faint star-field texture behind everything, echoing the emblem's three stars */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.55) 1px, transparent 1.4px),
        radial-gradient(circle, rgba(255,255,255,0.35) 1px, transparent 1.4px);
    background-size: 140px 140px, 90px 90px;
    background-position: 20px 30px, 60px 110px;
}

h1, h2, h3 { font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif; font-weight: 800; }

/* ---------- shared glass utility ---------- */
.glass {
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

/* ============ HEADER ============ */
header.top-header {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    padding: 14px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ink-glass-bg-strong);
    border-bottom: 1px solid var(--ink-glass-border);
    box-shadow: var(--shadow-soft);
}
header.top-header .brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.school-logo-frame {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--ink-glass-bg);
    border: 1px solid var(--ink-glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}
.school-logo-img { height: 100%; width: auto; display: block; }
.school-info h1 { font-size: 1.35rem; color: var(--text-on-dark); letter-spacing: 0.2px; }
.school-info p { font-size: 0.82rem; color: var(--text-on-dark-dim); margin-top: 2px; }

.header-star {
    color: var(--blue-400);
    font-size: 1.1rem;
    letter-spacing: 6px;
    opacity: 0.85;
    display: none;
}
@media (min-width: 700px) { .header-star { display: inline; } }

/* ============ LAYOUT ============ */
.page-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 22px;
    padding: 22px 5% 40px;
    align-items: flex-start;
}

/* ============ SIDEBAR ============ */
nav.sidebar-menu {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    background: var(--ink-glass-bg-strong);
    border: 1px solid var(--ink-glass-border);
    border-radius: var(--radius-lg);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-soft);
}
.menu-label {
    color: var(--text-on-dark-dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-right: 14px;
    text-transform: uppercase;
    border-right: 3px solid var(--blue-400);
}
nav.sidebar-menu a {
    color: var(--text-on-dark-dim);
    text-decoration: none;
    padding: 12px 14px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
nav.sidebar-menu a:hover {
    background: var(--ink-glass-bg);
    color: var(--text-on-dark);
    border-color: var(--ink-glass-border);
    transform: translateX(-2px);
}
nav.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(95,139,242,0.35), rgba(43,82,201,0.35));
    color: var(--text-on-dark);
    border-color: rgba(255,255,255,0.35);
    font-weight: 600;
}
nav.sidebar-menu a.active::after {
    content: "✦";
    margin-right: auto;
    color: var(--blue-200);
    font-size: 0.8rem;
}

/* ============ MAIN ============ */
main.main-content, main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 26px; }

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 46px 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(43,82,201,0.55), rgba(20,42,110,0.75));
    border: 1px solid var(--ink-glass-border);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-lift);
}
.hero-section::after {
    content: "✦";
    position: absolute;
    left: -10px;
    top: -30px;
    font-size: 9rem;
    color: rgba(255,255,255,0.06);
    transform: rotate(15deg);
}
.hero-section h2 { font-size: 2rem; color: var(--text-on-dark); margin-bottom: 10px; }
.hero-section p { color: var(--blue-200); font-size: 1.05rem; max-width: 60ch; }

.page-title { text-align: center; margin-bottom: 6px; }
.page-title h2 { font-size: 2rem; color: var(--text-on-dark); margin-bottom: 8px; }
.page-title p { color: var(--text-on-dark-dim); font-size: 1.05rem; }

/* ============ CARDS ============ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.card, .info-card {
    position: relative;
    overflow: hidden;
    background: var(--frost-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--frost-border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.card:hover, .info-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    background: var(--frost-bg-strong);
}
.card::before, .info-card::before {
    content: "✦";
    position: absolute;
    top: -14px;
    left: -10px;
    font-size: 3.4rem;
    color: rgba(30,64,175,0.08);
}
.card h2, .info-card h3 {
    font-size: 1.15rem;
    color: var(--blue-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card p, .info-card p {
    line-height: 1.8;
    color: var(--text-on-light-dim);
    font-size: 0.97rem;
    text-align: justify;
}
.card, .info-card { border-top: 4px solid var(--blue-700); border-radius: var(--radius-md); }

.highlight-quote {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--blue-700), var(--navy-800));
    color: #fff;
    padding: 28px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: var(--shadow-soft);
}

/* ============ FOOTER ============ */
footer.site-footer {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 22px 5%;
    background: var(--ink-glass-bg-strong);
    border-top: 1px solid var(--ink-glass-border);
    color: var(--text-on-dark-dim);
}
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.88rem;
    max-width: 1400px;
    margin: 0 auto;
}
.footer-row span { display: flex; align-items: center; gap: 6px; }
.visitor-badge {
    text-align: center;
    margin-top: 14px;
    font-size: 1rem;
    color: var(--text-on-dark);
    max-width: 1400px;
    margin-inline: auto;
}
.visitor-badge b {
    background: var(--ink-glass-bg);
    border: 1px solid var(--ink-glass-border);
    padding: 4px 14px;
    border-radius: 999px;
    color: var(--blue-200);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .page-wrapper { flex-direction: column; }
    nav.sidebar-menu {
        width: 100%;
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
    }
    .menu-label { display: none; }
    nav.sidebar-menu a { white-space: nowrap; }
    header.top-header { flex-direction: column; text-align: center; gap: 10px; }
    .hero-section { padding: 30px 24px; }
    .footer-row { flex-direction: column; text-align: center; }
}