﻿/* ==========================================================================
   AcademicNexus — Site.css
   ========================================================================== */

/* 1. DESIGN TOKENS
   ========================================================================== */
:root {
    /* Brand */
    --primary: #b60059;
    --primary-dark: #8f0044;
    --primary-light: #ffd9e1;
    --primary-glow: #e30071;
    --accent: #00dce5;
    /* Surfaces */
    --surface: #ffffff;
    --surface-2: #fff0f2;
    --surface-3: #ffe8ec;
    --canvas: #fff8f8;
    --border: #f0cdd7;
    --border-strong: #e7aeba;
    /* Text */
    --text-primary: #28161b;
    --text-secondary: #5c3f46;
    --text-muted: #906e76;
    /* Semantic */
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    /* Sidebar (light glass to match login) */
    --sb-bg-1: rgba(255,255,255,.82);
    --sb-bg-2: rgba(255,248,248,.90);
    --sb-border: rgba(227,0,113,.08);
    --sb-text: #28161b;
    --sb-text-muted: #7e5a62;
    /* Layout */
    --sidebar-w: 264px;
    --header-h: 64px;
    /* Radius & shadows */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
    --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 8px 24px -8px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.05);
    --shadow-lg: 0 20px 40px -12px rgba(15,23,42,.18);
    /* Gradients */
    --grad-admin: linear-gradient(135deg, #b60059 0%, #7c3aed 100%);
    --grad-educator: linear-gradient(135deg, #e30071 0%, #00dce5 100%);
    --grad-moderator: linear-gradient(135deg, #793eb0 0%, #b60059 100%);
    --grad-student: linear-gradient(135deg, #00696e 0%, #00dce5 100%);
    --azure-blue: #0078d4;
}

/* 2. RESET
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--canvas);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

    /* Subtle ambient background gradients for the canvas */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: radial-gradient(700px 400px at 88% -10%, rgba(227,0,113,.10), transparent 60%), radial-gradient(600px 380px at -10% 110%, rgba(0,220,229,.10), transparent 60%);
        pointer-events: none;
        z-index: 0;
    }

.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top .15s ease;
}

    .skip-link:focus {
        top: 12px;
    }

/* 3. LAYOUT
   ========================================================================== */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* 4. SIDEBAR
   ========================================================================== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 300;
    transition: transform .3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--sb-border);
    box-shadow: 1px 0 0 rgba(255,255,255,.35), 4px 0 24px rgba(121,62,176,.08);
}

    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(227,0,113,.18);
        border-radius: 4px;
    }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: rgba(227,0,113,.32);
        }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: var(--header-h);
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(227,0,113,.04), transparent);
}

.logo-image-container {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.sidebar-logo-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: none;
}

.logo-text {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.2px;
    display: block;
}

.logo-sub {
    color: var(--sb-text-muted);
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
    display: block;
    margin-top: 1px;
}

.nav-section {
    padding: 14px 0 10px;
    border-bottom: 1px solid var(--sb-border);
}

    .nav-section:last-of-type {
        border-bottom: 0;
    }

.nav-label {
    color: var(--sb-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 6px 20px 8px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    margin: 1px 10px;
    border-radius: 8px;
    color: var(--sb-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

    .nav-item:hover {
        background: rgba(227,0,113,.08);
        color: var(--primary-dark);
        text-decoration: none;
    }

    .nav-item.active, .nav-item:focus {
        background: linear-gradient(90deg, rgba(227,0,113,.16), rgba(0,220,229,.08));
        color: var(--primary-dark);
        box-shadow: inset 0 0 0 1px rgba(179,0,89,.14);
    }

        .nav-item.active::before {
            content: "";
            position: absolute;
            left: -10px;
            top: 8px;
            bottom: 8px;
            width: 3px;
            border-radius: 3px;
            background: linear-gradient(180deg, var(--primary-glow), var(--primary));
        }

    .nav-item i {
        width: 18px;
        text-align: center;
        font-size: 14px;
        color: var(--primary);
        transition: color .15s ease;
    }

    .nav-item:hover i, .nav-item.active i {
        color: var(--primary-dark);
    }

/* 5. MAIN CONTENT WINDOW
   ========================================================================== */
.main-content-window {
    flex-grow: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 6. TOP NAVBAR
   ========================================================================== */
.top-navbar {
    height: var(--header-h);
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.top-navbar-left {
    display: flex;
    align-items: center;
}

.page-context-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -.1px;
}

    .page-context-title::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--primary);
        margin-right: 10px;
        vertical-align: middle;
        box-shadow: 0 0 0 3px rgba(227,0,113,.14);
    }

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 4px 10px -3px rgba(179,0,89,.35);
}

/* 7. CANVAS & FOOTER
   ========================================================================== */
.body-content {
    padding: 32px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    width: 100%;
}

.footer-layout {
    margin-top: auto;
    padding: 28px 0 8px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

/* 8. REUSABLE PANELS / CARDS
   ========================================================================== */
.card-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.section-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .section-heading::before {
        content: "";
        width: 4px;
        height: 16px;
        border-radius: 4px;
        background: linear-gradient(180deg, var(--primary), var(--primary-glow));
    }

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
    display: inline-block;
}

/* 9. DASHBOARD-SPECIFIC COMPONENTS
   ========================================================================== */

/* Welcome banner */
.welcome-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    color: #fff;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

    .welcome-banner::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(600px 200px at 90% 0%, rgba(255,255,255,.24), transparent 60%);
        pointer-events: none;
    }

    .welcome-banner h2 {
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -.3px;
        margin-bottom: 4px;
    }

    .welcome-banner p {
        color: rgba(255,255,255,.86);
        font-size: 13.5px;
    }

    .welcome-banner .banner-icon {
        font-size: 56px;
        opacity: .25;
        transform: rotate(-8deg);
    }

.welcome-banner--admin {
    background: var(--grad-admin);
}

.welcome-banner--educator {
    background: var(--grad-educator);
}

.welcome-banner--moderator {
    background: var(--grad-moderator);
}

.welcome-banner--student {
    background: var(--grad-student);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-xs);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
    overflow: hidden;
}

    .stat-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(180deg, var(--primary), var(--primary-glow));
        opacity: 0;
        transition: opacity .18s ease;
    }

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: var(--border-strong);
    }

        .stat-card:hover::before {
            opacity: 1;
        }

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.stat-value {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px;
    margin-top: 4px;
    line-height: 1.1;
}

.stat-sub {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Quick actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
    transition: all .18s ease;
}

    .quick-action-btn i {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: var(--primary-light);
        color: var(--primary);
        font-size: 14px;
        transition: all .18s ease;
    }

    .quick-action-btn:hover {
        background: var(--surface);
        border-color: var(--primary);
        color: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
        text-decoration: none;
    }

        .quick-action-btn:hover i {
            background: var(--primary);
            color: #fff;
            transform: scale(1.05);
        }

    .quick-action-btn[aria-disabled="true"],
    .quick-action-btn.is-placeholder {
        opacity: .62;
        cursor: not-allowed;
    }

        .quick-action-btn[aria-disabled="true"]:hover,
        .quick-action-btn.is-placeholder:hover {
            transform: none;
            box-shadow: var(--shadow-xs);
            border-color: var(--border);
            color: var(--text-primary);
        }

            .quick-action-btn[aria-disabled="true"]:hover i,
            .quick-action-btn.is-placeholder:hover i {
                background: var(--primary-light);
                color: var(--primary);
                transform: none;
            }

/* Tables (GridView output) */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

    .table th, .table td {
        padding: 12px 14px;
        text-align: left;
    }

    .table th {
        background: var(--surface-2);
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: .6px;
        border-bottom: 1px solid var(--border);
    }

    .table td {
        border-bottom: 1px solid var(--border);
        color: var(--text-primary);
    }

    .table tr:last-child td {
        border-bottom: 0;
    }

    .table tr:hover td {
        background: var(--surface-2);
    }

/* 10. RESPONSIVE
   ========================================================================== */
@media screen and (max-width: 1024px) {
    :root {
        --sidebar-w: 240px;
    }

    .main-content-window {
        margin-left: 0;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

        .sidebar.mobile-open {
            transform: translateX(0);
            box-shadow: var(--shadow-lg);
        }

    .top-navbar-left::before {
        content: '\f0c9';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 18px;
        color: var(--text-secondary);
        margin-right: 16px;
        cursor: pointer;
        display: inline-block;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    .top-navbar {
        padding: 0 16px;
    }

    .user-profile-badge span {
        display: none;
    }

    .body-content {
        padding: 18px;
    }

    .welcome-banner {
        padding: 20px;
    }

        .welcome-banner h2 {
            font-size: 18px;
        }

        .welcome-banner .banner-icon {
            font-size: 40px;
        }

    .footer-layout {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
