﻿/* =========================================
   SchoolDock – inside.css (with Mobile Sidebar)
   ========================================= */

/* ===== VARIABLES ===== */
:root {
    --navy-deep: #0047AB;
    --navy-primary: #0000B3;
    --navy-mid: #0a0ac4;
    --navy-light: #4d4df0;
    --navy-soft: #e8eaff;
    --slate-ink: #0a0a1a;
    --slate-soft: #1a1a2e;
    --slate-mid: #4a4a6a;
    --slate-light: #7a7a99;
    --white: #ffffff;
    --gray-bg: #f8f9fc;
    --border-light: #e8eaf0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-bg);
    color: var(--slate-soft);
}

/* ===== APP SHELL ===== */
.app-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ========= SIDEBAR (Desktop) ========= */
.sidebar {
    width: 260px;
    background: linear-gradient(145deg, var(--navy-deep) 0%, #00009a 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: rgba(255,255,255,0.05);
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 10px;
    }

.sidebar-brand {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .brand-icon:hover {
        transform: scale(1.05);
        background: rgba(255,255,255,0.25);
    }

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

    .nav-item i {
        width: 22px;
        font-size: 1rem;
        color: rgba(255,255,255,0.5);
    }

    .nav-item:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }

    .nav-item.active {
        background: rgba(255,255,255,0.15);
        color: white;
        border-left: 3px solid var(--navy-light);
    }

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 16px;
}

.profile-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

    .profile-compact:hover {
        background: rgba(255,255,255,0.08);
    }

.avatar-sm {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--navy-light), var(--navy-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.profile-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
}

.profile-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
}

/* ========= MOBILE SIDEBAR OVERLAY ========= */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1;
        pointer-events: auto;
    }

/* ========= MOBILE SIDEBAR ========= */
.mobile-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: linear-gradient(145deg, var(--navy-deep) 0%, #00009a 100%);
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 16px;
    pointer-events: none;
}

    .mobile-sidebar.open {
        display: block !important;
        left: 0;
        pointer-events: auto;
    }

    .mobile-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-sidebar::-webkit-scrollbar-track {
        background: rgba(255,255,255,0.05);
    }

    .mobile-sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 10px;
    }

/* Mobile Sidebar Header */
.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}

.mobile-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .mobile-sidebar-brand .brand-icon {
        width: 36px;
        height: 36px;
        background: rgba(255,255,255,0.15);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .mobile-sidebar-brand .brand-name {
        font-size: 1.2rem;
        font-weight: 600;
        color: white;
    }

.mobile-sidebar-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .mobile-sidebar-close:hover {
        background: rgba(255,255,255,0.2);
        transform: rotate(90deg);
    }

/* Mobile Sidebar Navigation */
.mobile-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
}

    .mobile-sidebar-nav .nav-item {
        padding: 12px 14px;
        border-radius: 10px;
        color: rgba(255,255,255,0.7);
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 14px;
        transition: all 0.2s;
    }

        .mobile-sidebar-nav .nav-item i {
            width: 22px;
            font-size: 1rem;
            color: rgba(255,255,255,0.5);
        }

        .mobile-sidebar-nav .nav-item:hover {
            background: rgba(255,255,255,0.1);
            color: white;
        }

        .mobile-sidebar-nav .nav-item.active {
            background: rgba(255,255,255,0.15);
            color: white;
            border-left: 3px solid var(--navy-light);
        }

/* Mobile Sidebar Footer */
.mobile-sidebar-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

    .mobile-sidebar-footer .profile-compact {
        padding: 8px 12px;
    }

/* ========= HAMBURGER MENU BUTTON ========= */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 8px;
    transition: all 0.2s;
    z-index: 1001;
    position: relative;
}

    .hamburger-btn:hover {
        background: var(--navy-soft);
    }

    .hamburger-btn span {
        display: block;
        width: 22px;
        height: 2.5px;
        background: var(--slate-ink);
        border-radius: 4px;
        transition: all 0.3s;
    }

    .hamburger-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

/* ========= TOPBAR ========= */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-context {
    font-size: 0.8rem;
    color: var(--slate-light);
}

.context-current {
    font-weight: 600;
    color: var(--slate-ink);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-change-institution {
    background: var(--navy-soft);
    border: none;
    padding: 6px 16px;
    height: 34px;
    border-radius: 20px;
    color: var(--navy-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-change-institution:hover {
        background: var(--navy-primary);
        color: white;
        transform: translateY(-1px);
    }

/* ========= MAIN CONTENT ========= */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* THE SCROLLABLE AREA */
.content-scroll {
    flex: 1;
    overflow-y: auto !important;
    padding: 28px 32px;
    background: var(--gray-bg);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

    .content-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .content-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .content-scroll::-webkit-scrollbar-thumb {
        background: var(--border-light);
        border-radius: 10px;
    }

/* ========= PAGE STYLES ========= */
.welcome-header {
    margin-bottom: 28px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 650;
    color: var(--slate-ink);
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
}

.info-item {
    background: var(--white);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-light);
}

.card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slate-ink);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* ========= MODAL ========= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-container {
    width: 100%;
    max-width: 520px;
    margin: 20px;
}

.modal-card {
    background: var(--white);
    border-radius: 24px;
    padding: 36px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-wide {
    max-width: 740px;
}

/* ========= FORM ========= */
.form-group {
    margin-bottom: 18px;
}

    .form-group label {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--slate-mid);
        margin-bottom: 6px;
        display: block;
    }

    .form-group input, .form-group select {
        width: 100%;
        padding: 11px 16px;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        font-size: 0.85rem;
        transition: all 0.2s;
    }

        .form-group input:focus, .form-group select:focus {
            outline: none;
            border-color: var(--navy-primary);
            box-shadow: 0 0 0 3px rgba(0,0,163,0.1);
        }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn-submit {
    width: 100%;
    background: var(--navy-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

    .btn-submit:hover {
        background: var(--navy-mid);
        transform: translateY(-2px);
    }

/* ========= TOAST & LOADER ========= */
.toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.toast {
    background: var(--slate-ink);
    color: white;
    padding: 12px 24px;
    border-radius: 60px;
    font-size: 0.8rem;
    white-space: nowrap;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

    .global-loader.show {
        display: flex;
        animation: fadeIn 0.2s ease;
    }

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--navy-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ========= KEYFRAMES ========= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========= RESPONSIVE ========= */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    /* Hide desktop sidebar */
    .sidebar {
        display: none !important;
    }

    /* Show hamburger button */
    .hamburger-btn {
        display: flex !important;
    }

    /* Show mobile sidebar overlay */
    .sidebar-overlay {
        display: block !important;
    }

    /* Show mobile sidebar */
    .mobile-sidebar {
        display: block !important;
    }

    .content-scroll {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .btn-change-institution {
        padding: 4px 12px;
        font-size: 0.7rem;
    }

    .topbar-left .page-context {
        display: none;
    }
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .mobile-sidebar {
        width: 280px;
        max-width: 85vw;
    }
}
