/**
 * Campus Connect V4 — Design System
 * Glassmorphism + Antigravity-inspired aesthetics
 * Dark mode (default) + Light mode
 */

/* ============================================================================
   CSS VARIABLES & THEMING
   ============================================================================ */

:root {
    /* Colors - Dark Theme (Default) */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --accent-pink: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Backgrounds */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-card-hover: rgba(40, 40, 65, 0.85);
    --bg-input: rgba(40, 40, 70, 0.6);
    --bg-sidebar: rgba(15, 15, 26, 0.95);
    --bg-modal: rgba(0, 0, 0, 0.7);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    /* Borders & Shadows */
    --border: rgba(255, 255, 255, 0.08);
    --border-active: rgba(99, 102, 241, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --shadow-glow-sm: 0 0 10px rgba(99, 102, 241, 0.2);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --gradient-accent: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.7rem;
    --font-sm: 0.8125rem;
    --font-base: 0.9375rem;
    --font-lg: 1.0625rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 2rem;
    --font-4xl: 2.5rem;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --navbar-height: 60px;

    /* Particles */
    --particle-color: rgba(99, 102, 241, 0.5);
    --particle-line: rgba(99, 102, 241, 0.1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-sidebar: rgba(255, 255, 255, 0.97);
    --bg-modal: rgba(0, 0, 0, 0.5);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f1f5f9;

    --border: rgba(0, 0, 0, 0.08);
    --border-active: rgba(99, 102, 241, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-glow-sm: 0 0 10px rgba(99, 102, 241, 0.1);

    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(6, 182, 212, 0.03) 100%);
    --particle-color: rgba(99, 102, 241, 0.35);
    --particle-line: rgba(99, 102, 241, 0.08);
}

/* ============================================================================
   BASE RESET & BODY
   ============================================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--duration-fast);
}

a:hover {
    color: var(--primary);
}

::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ============================================================================
   PARTICLE CANVAS
   ============================================================================ */

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1 {
    font-size: var(--font-3xl);
    font-weight: 800;
    line-height: 1.2;
}

h2 {
    font-size: var(--font-2xl);
    font-weight: 700;
    line-height: 1.3;
}

h3 {
    font-size: var(--font-xl);
    font-weight: 600;
}

h4 {
    font-size: var(--font-lg);
    font-weight: 600;
}

.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-sm {
    font-size: var(--font-sm);
}

.text-xs {
    font-size: var(--font-xs);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-6);
    font-family: var(--font);
    font-size: var(--font-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-sm {
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--font-xs);
}

.btn-lg {
    padding: var(--sp-4) var(--sp-8);
    font-size: var(--font-base);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.form-group {
    margin-bottom: var(--sp-5);
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--sp-2);
}

.form-control {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    font-family: var(--font);
    font-size: var(--font-base);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration-base) var(--ease);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: var(--bg-card);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-4) center;
    padding-right: var(--sp-10);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-md);
    transition: all var(--duration-base) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-active);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: var(--font-xl);
    font-weight: 700;
}

/* Stat Card */
.stat-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    text-align: center;
    transition: all var(--duration-base) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    transition: opacity var(--duration-base);
    opacity: 0;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: var(--sp-2);
}

.stat-value {
    font-size: var(--font-3xl);
    font-weight: 800;
    color: var(--primary-light);
}

.stat-label {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--sp-1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-8);
}

/* ============================================================================
   NAVBAR
   ============================================================================ */

.navbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-6);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--duration-slow) var(--ease);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand img {
    height: 32px;
    width: auto;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.navbar-user:hover {
    border-color: var(--primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: 700;
    color: white;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--bg-sidebar);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--border);
    padding: var(--sp-4);
    overflow-y: auto;
    z-index: 90;
    transition: transform var(--duration-base) var(--ease), width var(--duration-base) var(--ease);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-item {
    margin-bottom: var(--sp-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-weight: 600;
}

.sidebar-link .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: var(--sp-4) 0;
}

.sidebar-heading {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--sp-2) var(--sp-4);
    margin-bottom: var(--sp-1);
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--sp-8);
    min-height: calc(100vh - var(--navbar-height));
    position: relative;
    z-index: 1;
    transition: margin-left var(--duration-base) var(--ease);
}

.page-header {
    margin-bottom: var(--sp-8);
}

.page-title {
    font-size: var(--font-3xl);
    font-weight: 800;
    margin-bottom: var(--sp-2);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-base);
}

/* ============================================================================
   TABS
   ============================================================================ */

.tab-nav {
    display: flex;
    gap: var(--sp-1);
    margin-bottom: var(--sp-6);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: var(--sp-3) var(--sp-5);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeSlideUp 0.3s var(--ease);
}

.tab-content.active {
    display: block;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-card);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

/* ============================================================================
   ALERTS & BADGES
   ============================================================================ */

.alert {
    padding: var(--sp-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-4);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--font-sm);
    animation: fadeSlideUp 0.3s var(--ease);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: var(--info);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--font-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    animation: fadeIn 0.2s var(--ease);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--sp-8);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-6);
}

.modal-title {
    font-size: var(--font-xl);
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: var(--font-lg);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

/* ============================================================================
   SBTE-STYLE ICON GRID
   ============================================================================ */

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--sp-4);
}

.icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    padding: var(--sp-6) var(--sp-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease);
    text-align: center;
}

.icon-tile:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.icon-tile .tile-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-tile .tile-label {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

.section-heading {
    font-size: var(--font-sm);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
}

/* ============================================================================
   DEMO BUTTON (Floating)
   ============================================================================ */

.demo-fab {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-6);
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-size: var(--font-sm);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    transition: all var(--duration-base) var(--ease);
    animation: fabBounce 2s ease-in-out infinite;
}

.demo-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
    animation: none;
}

@keyframes fabBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Demo Modal Chips */
.demo-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
}

.demo-chip {
    padding: var(--sp-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all var(--duration-fast);
    font-size: var(--font-sm);
    font-weight: 500;
}

.demo-chip:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.demo-chip .chip-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: var(--sp-2);
}

.demo-chip .chip-role {
    font-weight: 700;
    color: var(--text-primary);
}

.demo-chip .chip-user {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================================
   THEME TOGGLE
   ============================================================================ */

.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--duration-base);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    transform: rotate(30deg);
}

/* ============================================================================
   CAPTCHA
   ============================================================================ */

.captcha-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.captcha-question {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--primary-light);
    white-space: nowrap;
    user-select: none;
    background: var(--bg-input);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
}

.captcha-input {
    flex: 1;
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: var(--font-base);
    outline: none;
}

.captcha-input:focus {
    border-color: var(--primary);
}

.captcha-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.captcha-refresh:hover {
    transform: rotate(180deg);
    color: var(--primary);
}

/* ============================================================================
   TIMETABLE GRID
   ============================================================================ */

.timetable-grid {
    display: grid;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.timetable-cell {
    padding: var(--sp-3);
    border: 1px solid var(--border);
    font-size: var(--font-sm);
    text-align: center;
    transition: all var(--duration-fast);
    cursor: pointer;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timetable-cell:hover {
    background: var(--bg-card-hover);
}

.timetable-cell.header {
    background: var(--bg-card);
    font-weight: 700;
    color: var(--text-primary);
    cursor: default;
}

.timetable-cell .subject {
    font-weight: 600;
    color: var(--text-primary);
}

.timetable-cell .teacher-name {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* ============================================================================
   LOGIN PAGE SPECIFIC
   ============================================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    position: relative;
}

.login-wrapper {
    display: flex;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    max-width: 950px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s var(--ease);
    position: relative;
    z-index: 2;
}

.login-brand {
    flex: 1;
    background: var(--gradient-card);
    padding: var(--sp-12) var(--sp-10);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.login-form-panel {
    flex: 1;
    padding: var(--sp-10);
    background: var(--bg-secondary);
}

.version-badge {
    display: inline-block;
    background: var(--gradient-brand);
    color: white;
    padding: var(--sp-1) var(--sp-4);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 700;
    margin-bottom: var(--sp-4);
    position: relative;
    z-index: 1;
}

.login-brand h1 {
    font-size: var(--font-4xl);
    position: relative;
    z-index: 1;
}

.login-brand p {
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    margin-top: var(--sp-4);
    line-height: 1.8;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: var(--sp-4);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color var(--duration-fast);
}

.password-toggle:hover {
    color: var(--primary);
}

/* ============================================================================
   NOTIFICATION PANEL
   ============================================================================ */

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: var(--sp-4);
    margin-bottom: var(--sp-2);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    transition: all var(--duration-fast);
}

.notification-item:hover {
    background: var(--bg-card-hover);
}

.notification-item.unread {
    border-left-color: var(--accent);
}

.notification-title {
    font-weight: 600;
    margin-bottom: var(--sp-1);
}

.notification-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* ============================================================================
   BUS MAP
   ============================================================================ */

.map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-container .leaflet-container {
    height: 400px;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn var(--duration-base) var(--ease);
}

.fade-slide-up {
    animation: fadeSlideUp var(--duration-base) var(--ease);
}

.scale-in {
    animation: scaleIn var(--duration-base) var(--ease);
}

/* Staggered animations */
.stagger>* {
    animation: fadeSlideUp 0.4s var(--ease) backwards;
}

.stagger>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger>*:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger>*:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger>*:nth-child(8) {
    animation-delay: 0.4s;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-col {
    flex-direction: column;
}

.gap-1 {
    gap: var(--sp-1);
}

.gap-2 {
    gap: var(--sp-2);
}

.gap-3 {
    gap: var(--sp-3);
}

.gap-4 {
    gap: var(--sp-4);
}

.gap-6 {
    gap: var(--sp-6);
}

.gap-8 {
    gap: var(--sp-8);
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-2 {
    margin-top: var(--sp-2);
}

.mt-4 {
    margin-top: var(--sp-4);
}

.mt-6 {
    margin-top: var(--sp-6);
}

.mt-8 {
    margin-top: var(--sp-8);
}

.mb-2 {
    margin-bottom: var(--sp-2);
}

.mb-4 {
    margin-bottom: var(--sp-4);
}

.mb-6 {
    margin-bottom: var(--sp-6);
}

.mb-8 {
    margin-bottom: var(--sp-8);
}

.p-4 {
    padding: var(--sp-4);
}

.p-6 {
    padding: var(--sp-6);
}

.p-8 {
    padding: var(--sp-8);
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.overflow-auto {
    overflow: auto;
}

.overflow-hidden {
    overflow: hidden;
}

.relative {
    position: relative;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    :root {
        --font-3xl: 1.75rem;
        --font-4xl: 2rem;
    }

    .login-wrapper {
        flex-direction: column;
    }

    .login-brand {
        padding: var(--sp-8) var(--sp-6);
    }

    .login-form-panel {
        padding: var(--sp-8) var(--sp-6);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .demo-chips {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: var(--sp-4);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tab-nav {
        gap: 0;
    }

    .tab-btn {
        padding: var(--sp-2) var(--sp-3);
        font-size: var(--font-xs);
    }
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {

    .sidebar,
    .navbar,
    .demo-fab,
    #particles-canvas,
    .theme-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}