/* =========================================
   1. GLOBAL LOCK & RESET
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Keeps the dark side menu glitch away */
    background-color: white; 
    margin: 0; 
    padding: 0;
    position: relative;
    font-family: 'Outfit', sans-serif;
    color: #333;
    scroll-behavior: smooth;
}

/* =========================================
   2. VARIABLES
   ========================================= */
:root {
    --primary: #002244; 
    --gold: #FFD700;
    --dark: #0a0a0a;
    --light: #eaeff2;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #001a33 0%, #000c19 100%);
}

.scroll-progress {
    position: fixed; top: 0; left: 0; height: 4px; background: var(--gold);
    width: 0%; z-index: 9999; transition: 0.2s;
}

.section-padding { padding: 8rem 0; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }

/* =========================================
   3. NAVIGATION & HERO
   ========================================= */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    padding: 0.8rem 0;
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    width: 100%;
}
.nav-flex { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 15px; }
.school-crest { height: 55px; }
.logo-text { display: flex; flex-direction: column; color: var(--primary); font-weight: 800; text-decoration: none; }
.logo-sub { font-size: 0.7rem; color: var(--gold); letter-spacing: 2px; }

.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { color: var(--primary); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; transition: 0.3s; text-decoration: none; }
.btn-highlight { background: var(--primary); color: white !important; padding: 10px 25px; border-radius: 50px; text-decoration: none; border: none; cursor: pointer; }

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%; 
    background: var(--gradient);
    position: relative;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
    overflow: hidden;
}
.hero h1 { word-wrap: break-word; overflow-wrap: break-word; padding: 0 10px; }

#particles-js { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 900px; padding: 20px; width: 100%; }
.btn-primary { background: var(--gold); color: var(--primary); padding: 15px 40px; font-weight: 700; border-radius: 5px; text-decoration: none; display: inline-block; transition: 0.3s; }
.btn-primary:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3); }

/* =========================================
   4. HOME SECTIONS (Cards & Tiles)
   ========================================= */
.about-cards-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; /* Default: Side by Side */
    gap: 30px; 
}

.tilt-card { 
    background: white; 
    padding: 3rem; 
    border-radius: 20px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.1); 
    border-top: 5px solid var(--gold); 
    transition: 0.3s; 
}

.contact-bg { background: var(--primary); }
.contact-box { display: grid; grid-template-columns: 1fr 1.5fr; background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.contact-left { background: #001122; color: white; padding: 4rem; }
.contact-form { padding: 4rem; }

.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: stretch; }
.dashboard-card { 
    background: white; border-radius: 15px; overflow: hidden; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.1); 
    display: flex; flex-direction: column; height: 100%;
}
.dash-header { padding: 15px; color: white; font-weight: bold; display: flex; align-items: center; gap: 10px; }
.fb-card .dash-header { background: #1877F2; }
.tt-card .dash-header { background: #000000; }
.dash-content { height: 550px; overflow-y: auto; padding: 10px; background: #f0f2f5; display: flex; justify-content: center; }
.tiktok-embed { margin: 0 !important; }

footer { background: #050505; color: #666; padding: 3rem 0; }
.footer-flex { display: flex; justify-content: space-between; align-items: center; }
.admin-link { color: #444; transition: 0.3s; text-decoration: none; }
.admin-link:hover { color: var(--gold); }

/* =========================================
   5. CAREERS & VACANCIES
   ========================================= */
.job-card {
    background: white; border: 1px solid #ddd; padding: 25px; border-radius: 10px;
    margin-bottom: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: 0.3s;
    position: relative; overflow: hidden;
}
.job-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.job-card::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 5px; background: var(--primary); }

.job-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.job-title { font-size: 1.4rem; color: var(--primary); margin: 0; font-weight: 800; }
.job-meta { font-size: 0.85rem; color: #666; margin-top: 5px; display: flex; gap: 15px; }

.badge { padding: 5px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.badge-open { background: #e6fff0; color: #006622; border: 1px solid #b3ffcc; }
.badge-closed { background: #ffe6e6; color: #cc0000; border: 1px solid #ffb3b3; }

/* =========================================
   6. ADMISSIONS & FORM INPUTS
   ========================================= */
.form-container {
    max-width: 800px; margin: 50px auto;
    background: white; padding: 40px; border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); border-top: 5px solid #002244;
}

.form-section { margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.form-section h3 { color: #002244; margin-bottom: 15px; border-left: 4px solid #FFD700; padding-left: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full-width { grid-column: span 2; }

label { display: block; font-weight: bold; font-size: 0.9rem; margin-bottom: 8px; color: #555; }
input, textarea, select { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 20px; background: #f9f9f9; box-sizing: border-box; font-family: inherit; }

.radio-group { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.radio-group label { margin: 0; display: flex; align-items: center; gap: 5px; font-weight: normal; cursor: pointer; }
.radio-group input[type="radio"] { width: 18px; height: 18px; margin: 0; cursor: pointer; }

.btn-submit {
    display: block; width: 100%; padding: 18px;
    background: linear-gradient(135deg, #002244 0%, #004080 100%);
    color: white; font-size: 1.1rem; font-weight: bold; text-transform: uppercase;
    border: none; border-radius: 50px; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 34, 68, 0.3); transition: all 0.3s ease; margin-top: 30px;
}
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 34, 68, 0.4);
    background: linear-gradient(135deg, #004080 0%, #002244 100%);
}
.btn-submit:disabled { background: #ccc; cursor: not-allowed; transform: none; }

.doc-container { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 15px; }
.doc-card { background: #ffffff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.doc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: #002244; font-size: 1.1rem; font-weight: bold; }
.doc-header i { color: #FFD700; }
.custom-file-input { width: 100%; padding: 10px; background: #f8f9fa; border: 2px dashed #ccc; border-radius: 6px; cursor: pointer; }

.missing-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; }
.missing-row input { width: 18px; height: 18px; margin: 0; }
.missing-row label { font-size: 0.9rem; color: #d9534f; margin: 0; font-weight: 600; cursor: pointer; }

.reason-dropdown { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid #d9534f; background-color: #fff5f5; border-radius: 6px; display: none; color: #333; }
.transfer-highlight { background-color: #fff8e1; border-color: #ffe082; }

.other-input {
    width: 100%; margin-top: 5px; padding: 10px;
    border: 1px solid #002244; border-radius: 5px;
    display: none; background: #f0f8ff;
}

.submission-choice { display: flex; gap: 20px; flex-wrap: wrap; }
.submission-choice label { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
.submission-choice input { width: 20px !important; height: 20px !important; margin: 0 !important; }

/* =========================================
   7. LOGIN PAGE
   ========================================= */
.login-body { 
    background: var(--gradient); min-height: 100vh; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    position: relative; z-index: 10;
}
.login-container { width: 90%; max-width: 420px; padding: 20px; position: relative; z-index: 20; }
.login-card { 
    background: rgba(255, 255, 255, 0.98); padding: 40px 30px; 
    border-radius: 20px; border-top: 5px solid var(--gold); 
    text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-logo { width: 100px; height: auto; margin: 0 auto 20px auto; display: block; }
.back-link {
    display: inline-block; margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8); text-decoration: none;
    font-size: 0.9rem; font-weight: bold; transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.3); padding: 8px 15px; border-radius: 30px;
}
.back-link:hover { background: var(--gold); color: var(--primary); border-color: var(--gold); }
.input-group-modern { position: relative; margin-bottom: 20px; text-align: left; }
.input-group-modern label { font-size: 0.85rem; color: #666; margin-bottom: 5px; display: block; }
.input-group-modern input { width: 100%; padding: 12px 15px; border: 2px solid #eee; border-radius: 8px; background: #fdfdfd; box-sizing: border-box; }
.input-group-modern input:focus { border-color: var(--primary); outline: none; }
.btn-login { width: 100%; background: var(--primary); color: white; padding: 15px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s; }
.btn-login:hover { background: var(--gold); color: var(--primary); transform: translateY(-2px); }

/* =========================================
   8. MODAL / POPUP STYLES
   ========================================= */
.modal {
    display: none;
    position: fixed; 
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 34, 68, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%; 
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    position: relative;
    border-top: 6px solid #FFD700;
    animation: slideDown 0.3s ease-out;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.close:hover { color: #d9534f; }

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   9. ADMIN DASHBOARD & TABLES
   ========================================= */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    background: white;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table thead { background: #002244; color: white; }
.admin-table th { padding: 18px 15px; text-align: left; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.admin-table td { padding: 15px; border-bottom: 1px solid #eee; vertical-align: middle; color: #444; transition: 0.2s; }

.admin-table tbody tr { transition: background-color 0.2s; background-color: white; }
.admin-table tbody tr:hover { background-color: #f1f8ff !important; cursor: pointer; }
.admin-table tbody tr:hover td { color: #000 !important; }

/* Badge Styles */
.badge-grade { background: #e6f7ff; color: #0050b3; padding: 5px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; border: 1px solid #bae7ff; }

.badge {
    padding: 6px 12px;
    border-radius: 20px; 
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block; 
    text-align: center;
    min-width: 80px; 
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.action-buttons {
    display: flex; gap: 12px; justify-content: flex-end; align-items: center;
}

.btn-sm {
    width: 35px; height: 35px;
    border-radius: 8px; border: none; cursor: pointer;
    color: white; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-sm:hover { transform: scale(1.1); opacity: 0.9; }

.pay-btn { background-color: #28a745 !important; }
.view-btn { background-color: #002244 !important; }
.del-btn { background-color: #dc3545 !important; }

.admin-controls { display: flex; gap: 15px; margin-top: 15px; }
.search-box { padding: 12px; border: 1px solid #ddd; border-radius: 8px; flex: 1; }
.filter-box { padding: 12px; border: 1px solid #ddd; border-radius: 8px; background: white; }
.btn-export { background: #28a745; color: white; padding: 12px 20px; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 8px; text-decoration: none; transition: 0.3s; }
.btn-export:hover { background: #218838; transform: translateY(-2px); }

/* =========================================
   10. PRINT STYLES
   ========================================= */
@media print {
    :root { color-scheme: light; }
    body, html {
        background-color: white !important; color: black !important;
        margin: 0; padding: 0;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .navbar, .hero, footer, .form-container, .scroll-progress, .btn-submit, .modal, .admin-container, .admin-header, .close { 
        display: none !important; 
    }
    @page { size: A4 portrait; margin: 5mm; }
    #printableForm {
        display: block !important; visibility: visible !important;
        position: absolute; top: 0; left: 0;
        width: 100% !important; max-width: 210mm !important;
        background: white !important; padding: 10px;
        box-sizing: border-box; transform: scale(0.95); transform-origin: top left; color: black !important;
    }
    .print-header { border-bottom: 2px solid black !important; display: flex; align-items: center; justify-content: center; gap: 20px; padding-bottom: 5px; margin-bottom: 10px; }
    .print-section { border: 1px solid black !important; margin-bottom: 8px; padding: 4px; }
    .print-section h3 { background: #eee !important; color: black !important; border-bottom: 1px solid black !important; margin: 0 0 4px 0; padding: 2px; font-size: 11px; }
    .print-row { display: flex; width: 100%; gap: 5px; margin-bottom: 3px; }
    .box { flex: 1; border: 1px dotted #000 !important; padding: 2px; font-size: 10px; overflow: hidden; white-space: nowrap; color: black !important; }
    .box.full { width: 100%; }
}

/* =========================================
   11. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    /* === THE FIX: Force these into 1 column on mobile === */
    /* This ensures "Values" stacks below "Robotics" instead of cutting off */
    .grid-2, 
    .form-grid, 
    .social-grid, 
    .contact-box, 
    .about-cards-container { 
        grid-template-columns: 1fr; 
    }

    .nav-links { display: none; } 
    .full-width { grid-column: span 1; }
    
    .admin-controls { flex-direction: column; }
    .action-buttons { gap: 15px; }
    .btn-sm { width: 40px; height: 40px; }
}

/* =========================================
   12. SLIDER & MISC
   ========================================= */
.swiper { width: 100%; padding-top: 50px; padding-bottom: 50px; }
.swiper-slide { background-position: center; background-size: cover; width: 300px; height: 300px; border-radius: 10px; overflow: hidden; }
.swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 768px) {
    .swiper-slide { width: 70%; height: 250px; }
    .swiper { padding-top: 20px; padding-bottom: 30px; }
}

#btn-submit {
    display: block; width: 100%; padding: 18px 30px; margin-top: 30px;
    background-color: #002244; color: #FFD700; border: 2px solid #002244;
    font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px;
    border-radius: 50px; cursor: pointer; box-shadow: 0 10px 20px rgba(0, 34, 68, 0.2); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#btn-submit:hover {
    background-color: #FFD700; color: #002244; border-color: #FFD700;
    transform: translateY(-5px); box-shadow: 0 15px 30px rgba(255, 215, 0, 0.4);
}
#btn-submit:active { transform: scale(0.98); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); }
#btn-submit:disabled { background-color: #ccc; color: #666; border-color: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

#printableForm { display: none; }

/* =========================================
   13. MOBILE MENU FIX (Invisible Closed State)
   ========================================= */
@media (max-width: 768px) {
    
    .hamburger {
        display: block !important;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 2000;
        color: #002244;
        background: white;
        padding: 8px 12px;
        border-radius: 5px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        height: 100vh;
        background-color: #002244;
        
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 1500;

        /* === FIX FOR DARK SIDE === */
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden; 
        transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
        box-shadow: none !important; 
    }

    .nav-links.active {
        transform: translateX(0%);
        opacity: 1;
        visibility: visible;
        transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
        box-shadow: -10px 0 50px rgba(0,0,0,0.5) !important;
    }

    .nav-links li { margin: 25px 0; }
    .nav-links a { 
        font-size: 1.4rem; color: white !important;
        font-weight: bold; text-transform: uppercase; text-decoration: none;
    }

    .btn-highlight {
        border: 2px solid #FFD700;
        color: #FFD700 !important;
        padding: 10px 30px;
        border-radius: 50px;
    }
}