﻿/* =========================================
   SchoolDock – site.css (mature version)
   ========================================= */

/* ===== 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;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-bg);
    color: var(--slate-soft);
    min-height: 100vh;
}

/* Removed position: fixed; overflow: hidden from body – that was incorrect */
.app-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ========= SIDEBAR ========= */
.sidebar {
    width: 260px;
    background: linear-gradient(145deg, var(--navy-deep) 0%, #00009a 100%);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    overflow-y: auto;
}

    .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;
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

.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);
}

.logout-icon {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .logout-icon:hover {
        color: #ff6b6b;
        background: rgba(255,107,107,0.1);
        transform: scale(1.08);
    }

/* ========= TOPBAR ========= */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.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-icon {
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--slate-mid);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

    .btn-icon:hover {
        background: var(--navy-soft);
        color: var(--navy-primary);
        transform: translateY(-2px);
    }

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #c62828;
    border-radius: 50%;
}

.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;
    height: 100vh;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    background: var(--gray-bg);
    scroll-behavior: smooth;
}

    .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;
    }

/* ========= MOBILE NAV ========= */
.mobile-nav {
    display: none;
    background: var(--white);
    border-top: 1px solid var(--border-light);
    padding: 8px 12px;
}

.mobile-items {
    display: flex;
    justify-content: space-around;
}

.mob-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--slate-light);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

    .mob-item i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .mob-item span {
        font-size: 0.65rem;
        font-weight: 500;
    }

    .mob-item.active {
        color: var(--navy-primary);
        background: var(--navy-soft);
        transform: translateY(-2px);
    }

/* ========= PAGE STYLES (Home etc.) ========= */
.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);
}

/* Cards */
.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;
}

.card a {
    text-decoration: none !important;
    color: inherit !important;
    display: block; /* make the whole card clickable when link wraps elements */
}

    .card a:hover {
        text-decoration: none !important;
        color: inherit !important;
    }
    /* Also ensure inline icon wrappers don't show underline */
    .card a .bg-info-subtle, .card a .bg-info-subtle i {
        text-decoration: none !important;
    }
/* Stats */
.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy-primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--slate-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-row {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}

.progress-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--navy-primary);
    transition: width 1s ease;
}

/* Continue card */
.continue-card {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-deep) 100%);
    border-radius: 20px;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

    .continue-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 24px rgba(0,0,163,0.25);
    }

.continue-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}

.continue-title {
    font-size: 1rem;
    color: white;
    font-weight: 500;
}

.continue-btn {
    background: white;
    border: none;
    padding: 9px 24px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--navy-primary);
    cursor: pointer;
    transition: all 0.2s;
}

    .continue-btn:hover {
        transform: scale(1.02);
        background: var(--navy-soft);
    }

/* Quick rows */
.quick-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.25s;
}

    .quick-row:last-child {
        border-bottom: none;
    }

    .quick-row:hover {
        padding-left: 8px;
        background: var(--gray-bg);
        border-radius: 12px;
        margin: 0 -8px;
        padding: 12px 16px;
    }

.quick-icon {
    width: 40px;
    height: 40px;
    background: var(--navy-soft);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quick-row:hover .quick-icon {
    transform: scale(1.08);
    background: var(--navy-primary);
    color: white;
}

.quick-title {
    font-weight: 600;
    color: var(--slate-ink);
    font-size: 0.9rem;
}

.quick-sub {
    font-size: 0.7rem;
    color: var(--slate-light);
    margin-top: 2px;
}

.quick-meta {
    font-size: 0.7rem;
    color: var(--navy-primary);
    margin-top: 4px;
}

/* Buttons */
.quiz-btn {
    background: var(--navy-soft);
    border: none;
    padding: 12px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--navy-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    transition: all 0.2s;
}

    .quiz-btn:hover {
        background: var(--navy-primary);
        color: white;
        transform: scale(0.98);
    }

.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);
    }

/* ========= 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;
}

.modal-close {
    position: fixed;
    top: 24px;
    right: 28px;
    background: rgba(0,0,0,0.6);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.2s;
}

    .modal-close:hover {
        transform: scale(1.1) rotate(90deg);
        background: rgba(0,0,0,0.7);
    }

/* ========= 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;
}

/* ========= FAB ========= */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    background: var(--navy-primary);
    border: none;
    border-radius: 26px;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,163,0.35);
    transition: all 0.3s ease;
}

    .fab:hover {
        background: var(--navy-mid);
        transform: scale(1.1) rotate(5deg);
    }

/* ========= 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);
    }
}

/* ========= UTILITY & GRID ========= */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.hint-text {
    font-size: 0.75rem;
    color: var(--slate-light);
    margin-top: 8px;
}

/* ========= ACCESSIBILITY ========= */
:focus-visible {
    outline: 2px solid var(--navy-primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ========= RESPONSIVE ========= */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sidebar {
        display: none; /* Can be toggled with JS if needed */
    }

    .mobile-nav {
        display: block;
    }

    .content-scroll {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .fab {
        bottom: 75px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .btn-change-institution {
        padding: 4px 12px;
        font-size: 0.7rem;
    }
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
