/* ============================================
   NUTECH Academic Result Management System
   Main Stylesheet - Dark Navy Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables */
:root {
  --bg-primary: #080d1a;
  --bg-secondary: #0d1428;
  --bg-card: #111828;
  --bg-card-hover: #162032;
  --bg-input: #0d1428;
  --bg-sidebar: #080d1a;

  --accent: #00c4ff;
  --accent-dark: #0088cc;
  --accent-glow: rgba(0, 196, 255, 0.15);
  --accent-secondary: #7c3aed;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-orange: #f97316;

  --text-primary: #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --text-link: #00c4ff;

  --border: rgba(255,255,255,0.07);
  --border-accent: rgba(0,196,255,0.3);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 18px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-accent: 0 0 20px rgba(0,196,255,0.2);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.3);

  --sidebar-width: 260px;
  --header-height: 64px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #1e3050; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; }
p { color: var(--text-secondary); }
a { color: var(--text-link); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* ============================================
   LAYOUT
   ============================================ */
.app-layout { display: flex; min-height: 100vh; }

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; }
.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-text strong { font-size: 14px; color: var(--text-primary); display: block; }
.sidebar-logo-text span { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { padding: 8px 16px 4px; }
.nav-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }

.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; cursor: pointer; transition: all var(--transition); border-left: 3px solid transparent; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); border-left-color: var(--accent); color: var(--accent); }
.nav-item svg, .nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-accent); }
.sidebar-user-info strong { font-size: 13px; display: block; color: var(--text-primary); }
.sidebar-user-info span { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

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

/* Topbar */
.topbar {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.menu-toggle { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; }

/* Page Content */
.page-content { flex: 1; padding: 28px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--accent); }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.stat-card.success::before { background: var(--accent-success); }
.stat-card.warning::before { background: var(--accent-warning); }
.stat-card.danger::before { background: var(--accent-danger); }
.stat-card.purple::before { background: var(--accent-secondary); }

.stat-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-card); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}
.stat-icon.success { background: rgba(16,185,129,0.15); }
.stat-icon.warning { background: rgba(245,158,11,0.15); }
.stat-icon.danger { background: rgba(239,68,68,0.15); }
.stat-icon.purple { background: rgba(124,58,237,0.15); }

.stat-info strong { font-size: 24px; font-weight: 800; display: block; }
.stat-info span { font-size: 12px; color: var(--text-muted); }

/* ============================================
   TABLES
   ============================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { background: var(--bg-secondary); color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-card-hover); }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
.form-control[disabled] { opacity: 0.5; cursor: not-allowed; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--accent-danger); margin-top: 5px; }

.input-group { position: relative; }
.input-group .form-control { padding-left: 40px; }
.input-group .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; pointer-events: none; }
.input-group .input-icon-right { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; font-size: 16px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-dark); box-shadow: var(--shadow-accent); }

.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-success { background: var(--accent-success); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--accent-danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-warning { background: var(--accent-warning); color: #000; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; }

/* ============================================
   BADGES
   ============================================ */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; }
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-primary { background: rgba(0,196,255,0.15); color: var(--accent); }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-orange { background: rgba(249,115,22,0.15); color: #f97316; }
.badge-secondary { background: rgba(255,255,255,0.07); color: var(--text-muted); }

/* ============================================
   ALERTS
   ============================================ */
.alert { padding: 12px 16px; border-radius: var(--border-radius-sm); font-size: 14px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.alert-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34d399; }
.alert-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info { background: rgba(0,196,255,0.1); border-color: rgba(0,196,255,0.3); color: var(--accent); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,196,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -200px; left: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.06) 0%, transparent 70%);
  pointer-events: none;
}

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

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.login-logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.login-logo-text strong { font-size: 22px; font-weight: 800; display: block; }
.login-logo-text span { font-size: 11px; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; }
.login-subtitle { color: var(--text-muted); font-size: 14px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Role Tabs */
.role-tabs { display: flex; border-bottom: 1px solid var(--border); }
.role-tab { flex: 1; padding: 14px; text-align: center; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: all var(--transition); border-bottom: 2px solid transparent; }
.role-tab:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.role-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-glow); }

/* Auth Method Tabs */
.auth-tabs { display: flex; gap: 6px; padding: 16px 20px 0; }
.auth-tab { flex: 1; padding: 8px 6px; text-align: center; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-muted); transition: all var(--transition); border-radius: 6px; border: 1px solid var(--border); }
.auth-tab:hover { border-color: var(--accent); color: var(--accent); }
.auth-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }

.auth-form-area { padding: 20px; }
.auth-form { display: none; }
.auth-form.active { display: block; }

/* Google Button */
.btn-google {
  width: 100%;
  background: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-google:hover { background: #f5f5f5; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.btn-google img { width: 20px; height: 20px; }

/* OTP Inputs */
.otp-inputs { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.otp-input {
  width: 46px; height: 54px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  transition: all var(--transition);
  outline: none;
}
.otp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ============================================
   UTILITIES
   ============================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary-c { color: var(--text-primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.font-mono { font-family: var(--font-mono); }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.separator { height: 1px; background: var(--border); margin: 20px 0; }
.separator-text { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-muted); font-size: 12px; }
.separator-text::before, .separator-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Spinner */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Avatar */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 64px; height: 64px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { color: var(--text-secondary); font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 100vw rgba(0,0,0,0.5); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .page-content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .auth-tabs { flex-direction: column; }
}

/* ============================================
   PRINT (for transcripts)
   ============================================ */
@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  table th { background: #f0f0f0; color: #333; }
}
