/* ============================================
   portal.css — US Academy Student Portal
   Dark Glassmorphism Theme
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --bg-dark: #070B14;
    --bg-darker: #040810;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --brand-blue: #4285F4;
    --brand-gold: #FBBC05;
    --brand-green: #34A853;
    --brand-red: #EA4335;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --mobile-nav-height: 68px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 30px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-dark: #f0f4f8;
    --bg-darker: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

/* ---- Global Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Utilities ---- */
.hidden { display: none !important; }

.text-gradient {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gold { color: var(--brand-gold); }
.text-green { color: var(--brand-green); }
.text-blue { color: var(--brand-blue); }

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue), #2563eb);
    color: #fff;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.5);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
}
.btn-outline:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    background: rgba(66, 133, 244, 0.08);
}

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

.btn-icon-sm {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon-sm:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: rgba(234, 67, 53, 0.1);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

#login-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
}

.login-card {
    text-align: center;
    padding: 2.5rem 2rem !important;
    background: rgba(10, 15, 30, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    animation: fadeIn 0.6s ease;
}

.login-logo {
    height: 56px;
    margin: 0 auto 1.2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Form elements */
.form-group {
    text-align: left;
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}
.form-group label i {
    margin-right: 0.3rem;
    font-size: 0.75rem;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}
.form-group input::placeholder {
    color: var(--text-muted);
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.hint {
    display: block;
    font-size: 0.75rem;
    color: var(--brand-gold);
    margin-top: 0.4rem;
    font-style: italic;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
}
.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-blue);
    cursor: pointer;
}
.form-check label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-loader { gap: 0.5rem; }

.alert-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    background: rgba(234, 67, 53, 0.12);
    border: 1px solid rgba(234, 67, 53, 0.25);
    border-radius: var(--radius-sm);
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.login-footer-link {
    text-align: center;
    margin-top: 1.5rem;
}
.login-footer-link a {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: color var(--transition);
}
.login-footer-link a:hover { color: var(--brand-blue); }

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--bg-dark);
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-darker);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.2rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.sidebar-logo { height: 36px; flex-shrink: 0; }

.sidebar-student-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.sidebar-student-info p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-close {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
}
.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
    color: var(--brand-blue);
    background: rgba(66, 133, 244, 0.1);
    border-left: 3px solid var(--brand-blue);
    padding-left: calc(1rem - 3px);
    font-weight: 600;
}

.nav-disabled { opacity: 0.55; }
.nav-disabled:hover { opacity: 0.75; }

.nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-divider span {
    background: var(--bg-darker);
    padding: 0 0.8rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-count {
    position: absolute;
    right: 10px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--brand-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-coming {
    position: absolute;
    right: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(165, 110, 255, 0.2));
    color: #a78bfa;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border-subtle);
}

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    min-height: var(--topbar-height);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-left h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}
.menu-toggle:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.topbar-date i { color: var(--brand-blue); }

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    cursor: default;
}

/* ---- Mobile Bottom Nav ---- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(4, 8, 16, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    padding: 0.4rem 0;
    height: var(--mobile-nav-height);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 0.3rem 0;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item i { font-size: 1.15rem; }
.mobile-nav-item.active {
    color: var(--brand-blue);
}
.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--brand-blue);
    border-radius: 2px;
}

.mobile-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand-red);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   TAB PANELS
   ============================================ */
.tab-panel {
    display: none;
    padding: 1.5rem 2rem 3rem;
    animation: fadeIn 0.4s ease;
}
.tab-panel.active { display: block; }

/* ============================================
   OVERVIEW TAB
   ============================================ */

/* Welcome Banner */
.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.12), rgba(165, 110, 255, 0.08)) !important;
    border: 1px solid rgba(66, 133, 244, 0.15) !important;
    margin-bottom: 1.5rem;
    padding: 2rem !important;
}
.welcome-text h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}
.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.welcome-icon {
    animation: float 4s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated emoji inline with welcome text */
.welcome-animated-emoji {
    display: inline-block;
    width: 36px;
    height: 36px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Large animated emoji on the right side of banner */
.welcome-animated-emoji-lg {
    width: 72px;
    height: 72px;
    opacity: 0.85;
    filter: drop-shadow(0 4px 12px rgba(251, 188, 5, 0.3));
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.stat-card-portal {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent, var(--brand-blue));
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.stat-card-portal:hover {
    border-color: var(--accent, var(--brand-blue));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent, var(--brand-blue));
    background: color-mix(in srgb, var(--accent, var(--brand-blue)) 15%, transparent);
    flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }
.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    padding: 1.5rem !important;
}
.chart-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chart-card h3 i { color: var(--brand-blue); font-size: 0.85rem; }

/* Donut Chart */
.donut-chart-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color, var(--brand-blue)) calc(var(--pct, 0) * 3.6deg),
        rgba(255, 255, 255, 0.05) calc(var(--pct, 0) * 3.6deg)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.8s ease;
}

.donut-center {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.donut-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-blue);
}
.donut-center small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.legend-item i { font-size: 0.5rem; }

/* Subject Bars */
.subject-bars {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.subject-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.subject-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}
.subject-bar-label span:first-child { color: var(--text-primary); font-weight: 500; }
.subject-bar-label span:last-child { color: var(--text-muted); }
.subject-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}
.subject-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Activity Row */
.activity-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.activity-card { padding: 1.5rem !important; }
.activity-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.activity-card h3 i { color: var(--brand-gold); font-size: 0.85rem; }

.activity-feed, .dues-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 280px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }
.activity-item i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 168, 83, 0.12);
    color: var(--brand-green);
    font-size: 0.8rem;
    flex-shrink: 0;
}
.activity-item-text {
    flex: 1;
    min-width: 0;
}
.activity-item-text p {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-item-text small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.due-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.due-item:last-child { border-bottom: none; }
.due-subject-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(66, 133, 244, 0.15);
    color: var(--brand-blue);
    white-space: nowrap;
    flex-shrink: 0;
}
.due-item-info {
    flex: 1;
    min-width: 0;
}
.due-item-info p {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.due-item-date {
    font-size: 0.72rem;
    color: var(--brand-gold);
    font-weight: 600;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}
.empty-state i { font-size: 2.5rem; margin-bottom: 0.8rem; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.3rem; color: var(--text-secondary); }
.empty-state p { font-size: 0.85rem; }
.empty-state.small { padding: 1.5rem 1rem; }
.empty-state.small i { font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state.small p { font-size: 0.78rem; }

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}
.loading-state p { margin-top: 1rem; font-size: 0.85rem; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   ASSIGNMENTS TAB
   ============================================ */
.tab-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}
.filter-group label i { margin-right: 0.25rem; }

.filter-group select {
    padding: 0.55rem 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    min-width: 160px;
}
.filter-group select:focus { border-color: var(--brand-blue); }
.filter-group select option { background: #1a1f2e; color: #fff; }

.result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.assignments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
}

.assignment-card {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    transition: all var(--transition);
}
.assignment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--border-hover);
}

.assignment-accent {
    height: 3px;
    width: 100%;
}
.assignment-card[data-status="submitted"] .assignment-accent { background: var(--brand-green); }
.assignment-card[data-status="pending"] .assignment-accent { background: var(--brand-gold); }
.assignment-card[data-status="overdue"] .assignment-accent { background: var(--brand-red); }

.assignment-body { padding: 1.2rem 1.3rem; }

.assignment-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.assignment-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.assignment-status {
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.status-submitted { background: rgba(52, 168, 83, 0.15); color: var(--brand-green); }
.status-pending { background: rgba(251, 188, 5, 0.15); color: var(--brand-gold); }
.status-overdue { background: rgba(234, 67, 53, 0.15); color: var(--brand-red); }

.assignment-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.meta-item {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.meta-item i { font-size: 0.65rem; }

.assignment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-subtle);
}

/* ============================================
   QUESTION PAPERS TAB
   ============================================ */
.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
}

.paper-card {
    transition: all var(--transition);
}
.paper-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--border-hover);
}

.paper-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}
.paper-title {
    font-size: 1rem;
    font-weight: 600;
}
.paper-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.paper-meta-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.subject-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(66, 133, 244, 0.15);
    color: var(--brand-blue);
}
.batch-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(165, 110, 255, 0.12);
    color: #a78bfa;
}

.paper-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-subtle);
}
.no-solution {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   PLACEHOLDER TABS
   ============================================ */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 1rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.placeholder-icon-wrap {
    position: relative;
    margin-bottom: 1.5rem;
}
.placeholder-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--brand-blue);
    position: relative;
    z-index: 1;
}
.placeholder-glow {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 133, 244, 0.2), transparent 70%);
    animation: pulse-glow 3s ease-in-out infinite;
}

.placeholder-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.placeholder-content > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.placeholder-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(165, 110, 255, 0.15));
    color: #a78bfa;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.placeholder-features {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}
.placeholder-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.placeholder-feature i { color: var(--brand-blue); }

/* ============================================
   PROFILE TAB
   ============================================ */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 850px;
    margin: 0 auto;
}

.profile-card {
    text-align: center;
    padding: 2.5rem 2rem !important;
}

.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    position: relative;
    z-index: 1;
}
.profile-avatar-glow {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 133, 244, 0.2), transparent 70%);
    animation: pulse-glow 3s ease-in-out infinite;
}

.profile-card h2 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.profile-class-text { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.5rem; }

.profile-details {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.profile-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.profile-row:last-child { border-bottom: none; }
.profile-row > i {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(66, 133, 244, 0.1);
    color: var(--brand-blue);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.profile-row div { display: flex; flex-direction: column; }
.profile-row label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.profile-row span { font-size: 0.9rem; font-weight: 500; }
.status-active { color: var(--brand-green); }

.profile-stats-card {
    padding: 2rem !important;
}
.profile-stats-card h3 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.profile-stats-card h3 i { color: var(--brand-blue); }

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}
.profile-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}
.profile-stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}
.profile-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-actions { margin-top: 1.5rem; }

/* ============================================
   UPLOAD MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.upload-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 2rem !important;
    background: rgba(10, 15, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}
.modal-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.modal-header h3 i { color: var(--brand-blue); }

.modal-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.modal-close-btn:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.upload-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
    margin-bottom: 1rem;
    cursor: pointer;
}
.drop-zone:hover { border-color: rgba(66, 133, 244, 0.4); }

.drop-zone.drag-over {
    border-color: var(--brand-blue);
    background: rgba(66, 133, 244, 0.06);
    transform: scale(1.01);
}

.drop-icon {
    font-size: 2.5rem;
    color: var(--brand-blue);
    opacity: 0.5;
    margin-bottom: 0.8rem;
}
.drop-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.drop-divider {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
}
.drop-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
}

/* File Preview */
.file-preview { margin-bottom: 1rem; }
.file-info-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}
.file-icon {
    font-size: 1.5rem;
    color: var(--brand-red);
    flex-shrink: 0;
}
.file-details { flex: 1; min-width: 0; }
.file-name-text {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-size-text {
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* Upload Progress */
.upload-progress {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.progress-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
    transition: width 0.3s ease;
    width: 0%;
}
.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 80px;
}

/* Upload Result */
.upload-result {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}
.upload-result.success {
    background: rgba(52, 168, 83, 0.1);
    border: 1px solid rgba(52, 168, 83, 0.25);
    color: var(--brand-green);
}
.upload-result.error {
    background: rgba(234, 67, 53, 0.1);
    border: 1px solid rgba(234, 67, 53, 0.25);
    color: var(--brand-red);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close { display: flex; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
    }
    .tab-panel {
        padding: 1.2rem 1rem 5rem;
    }
    .topbar { padding: 0.6rem 1rem; }
    .welcome-banner { flex-direction: column; text-align: center; padding: 1.5rem !important; }
    .welcome-icon { margin-top: 0.5rem; }
    .welcome-animated-emoji-lg { width: 52px; height: 52px; }
    .welcome-animated-emoji { width: 28px; height: 28px; }
    .welcome-text h2 { font-size: 1.2rem; }
    .charts-row { grid-template-columns: 1fr; }
    .activity-row { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .assignments-grid { grid-template-columns: 1fr; }
    .papers-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; width: 100%; }
    .filter-group select { width: 100%; }
    .tab-toolbar { flex-direction: column; align-items: flex-start; }
    .topbar-date { display: none; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .stat-card-portal { padding: 0.9rem 0.8rem; }
    .stat-value { font-size: 1.3rem; }
    .donut-chart { width: 130px; height: 130px; }
    .donut-center { width: 90px; height: 90px; }
    .donut-value { font-size: 1.4rem; }
    .login-card { padding: 2rem 1.5rem !important; }
    .login-title { font-size: 1.6rem; }
    .placeholder-features { flex-direction: column; align-items: center; }
    .profile-stats-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .upload-card { padding: 1.5rem !important; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* --- TEST SCORES --- */
.test-score-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--border-hover);
}


.main-content { min-width: 0; max-width: 100vw; overflow-x: hidden; }
.dashboard { width: 100%; max-width: 100vw; }

