/* ============================================================
   QuadSec Forensics - Student Portal CSS
   students/css/portal.css
   Inherits variables from css/main.css
============================================================ */

/* ── Portal layout ────────────────────────────────────── */
.portal-body { overflow-x: hidden; }

.portal-layout {
    display: flex;
    min-height: calc(100vh - 60px);
    margin-top: 60px;
}

.portal-public {
    min-height: 100vh;
    background: var(--bg-body);
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 240px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--border-dim);
    min-height: 64px;
}
.sidebar__close {
    display: none; background: none; border: none;
    color: var(--text-muted); cursor: pointer; font-size: 1.1rem;
}

.sidebar__user {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-dim);
}
.sidebar__name { font-size: .9rem; font-weight: 600; color: var(--text); }
.sidebar__role { font-size: .75rem; color: var(--teal); }

.sidebar__nav {
    flex: 1;
    display: flex; flex-direction: column;
    padding: .75rem 0;
    gap: 2px;
}
.sidebar__link {
    display: flex; align-items: center; gap: .7rem;
    padding: .65rem 1.2rem;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.15s;
    text-decoration: none;
}
.sidebar__link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.sidebar__link.active {
    background: rgba(0,212,170,.08);
    color: var(--teal);
    border-right: 3px solid var(--teal);
}
.sidebar__icon { font-size: 1rem; min-width: 20px; }
.sidebar__link--danger:hover { color: var(--danger); background: rgba(226,75,74,.06); }

/* ── Top bar ──────────────────────────────────────────── */
.portal-topbar {
    position: fixed; top: 0; left: 240px; right: 0; z-index: 800;
    height: 60px;
    background: rgba(10,15,30,.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-dim);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem;
}
.topbar__burger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
}
.topbar__burger span { display: block; width: 20px; height: 2px; background: var(--text-muted); border-radius: 2px; }
.topbar__title { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; flex: 1; }
.topbar__right { display: flex; align-items: center; gap: .75rem; }

/* ── Main content ─────────────────────────────────────── */
.portal-main {
    flex: 1;
    margin-left: 240px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
}

/* ── Avatar ───────────────────────────────────────────── */
.avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-dim), var(--teal));
    color: #0A0F1E;
    font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
}
.avatar--sm { width: 34px; height: 34px; font-size: .8rem; }

/* ── Dashboard widgets ────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.stat-card__icon { font-size: 1.6rem; margin-bottom: .6rem; }
.stat-card__num  { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--teal); }
.stat-card__label { font-size: .8rem; color: var(--text-muted); }

/* ── Progress bar ─────────────────────────────────────── */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: var(--teal); border-radius: 3px; transition: width .4s; }

/* ── Course row (in dashboard) ────────────────────────── */
.course-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: .75rem;
    transition: border-color .15s;
}
.course-row:hover { border-color: var(--teal); }
.course-row__thumb {
    width: 56px; height: 56px; border-radius: var(--radius);
    background: var(--bg-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; flex-shrink: 0;
}
.course-row__info { flex: 1; }
.course-row__title { font-weight: 600; margin-bottom: .25rem; }
.course-row__meta  { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }

/* ── Section header (inside portal) ──────────────────── */
.portal-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.portal-section-header h2 { font-size: 1.2rem; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: 4px 0 24px rgba(0,0,0,.5);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar__close { display: block; }
    .portal-topbar { left: 0; }
    .topbar__burger { display: flex; }
    .portal-main { margin-left: 0; padding: 1.25rem; }
    .portal-layout { margin-top: 60px; }
}