/**
 * MNJ LMS - Core Mobile-First 3G Ultra-Fast Stylesheet
 * High performance, zero bloat, native fonts, clean responsive layout
 */

:root {
    --primary: #FF6B4A;
    --primary-hover: #fa541c;
    --secondary: #4CAF50;
    --secondary-hover: #388E3C;
    --accent: #FFC107;
    --blue: #1890FF;
    --purple: #722ED1;
    --dark: #2C3E50;
    --light: #F8FAFC;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --text-muted: #64748B;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Sinhala", "Iskoola Pota", sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: var(--transition);
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Global Navbar */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.brand-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.brand-text-desktop {
    display: inline;
}

.brand-text-mobile {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Standard Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }

.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-secondary:hover { background: var(--secondary-hover); }

.btn-parent {
    background: #E8F5E9;
    color: #2E7D32;
    border: 2px solid #81C784;
}
.btn-parent:hover { background: #C8E6C9; }

.btn-admin {
    background: #EDE7F6;
    color: #512DA8;
    border: 2px solid #B39DDB;
}
.btn-admin:hover { background: #D1C4E9; }

/* Stars & Score pill */
.star-pill {
    background: #FFF9C4;
    border: 2px solid #FBC02D;
    color: #F57F17;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
}

/* Modal styles for Parent Gate */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.pin-display {
    font-size: 2rem;
    letter-spacing: 12px;
    height: 50px;
    margin: 15px 0;
    background: #F1F5F9;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.pin-btn {
    padding: 14px;
    font-size: 1.4rem;
    font-weight: 700;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.pin-btn:hover {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

/* Responsive Tweaks across Small Mobile, Mobile, Tablet & Desktop */
@media (max-width: 768px) {
    .brand-text-desktop { display: none; }
    .brand-text-mobile { display: inline; font-size: 1.05rem; }
    .brand-logo { width: 34px; height: 34px; }
}

@media (max-width: 520px) {
    .nav-wrap {
        height: auto;
        min-height: 54px;
        padding: 6px 12px;
        gap: 6px;
    }
    .brand {
        font-size: 0.95rem;
        gap: 6px;
    }
    .brand-logo { width: 30px; height: 30px; }
    .brand-text-mobile { font-size: 0.92rem; font-weight: 800; }
    .nav-actions {
        gap: 6px;
    }
    .nav-text-hide-mobile {
        display: none !important;
    }
    .nav-btn-compact {
        padding: 6px 10px !important;
        font-size: 0.9rem !important;
        border-radius: 12px !important;
    }
    .nav-btn-logout {
        padding: 6px 8px !important;
        font-size: 0.9rem !important;
        border-radius: 12px !important;
        background: #F1F5F9;
        color: #64748B;
    }
    .star-pill {
        padding: 4px 8px !important;
        font-size: 0.9rem !important;
        gap: 4px !important;
    }
    .star-pill img {
        width: 16px !important;
        height: 16px !important;
    }
}

@media (max-width: 360px) {
    .brand-text-mobile {
        display: none; /* Icon-only logo on very narrow phones */
    }
    .nav-wrap {
        padding: 4px 8px;
    }
}
