/* ============================================================
   BSNL ExamPrep — Premium Design System
   Version 2.0 | Professional Examination Platform
   ============================================================ */

:root {
  /* Brand Colors */
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #3b82f6;
  --primary-soft:   #eff6ff;
  --primary-border: #bfdbfe;

  --success:        #059669;
  --success-soft:   #ecfdf5;
  --success-border: #a7f3d0;

  --warning:        #d97706;
  --warning-soft:   #fffbeb;
  --warning-border: #fde68a;

  --danger:         #dc2626;
  --danger-soft:    #fef2f2;
  --danger-border:  #fecaca;

  --purple:         #7c3aed;
  --purple-soft:    #f5f3ff;

  --orange:         #ea580c;
  --orange-soft:    #fff7ed;

  /* Neutrals */
  --text-main:    #0f172a;
  --text-body:    #334155;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;

  --bg-app:       #f1f5f9;
  --bg-surface:   #ffffff;
  --bg-hover:     #f8fafc;
  --bg-subtle:    #f1f5f9;

  --border-light: rgba(0,0,0,0.06);
  --border-main:  rgba(0,0,0,0.10);
  --border-focus: var(--primary);

  /* Spacing */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px;
  --space-4: 16px; --space-5: 20px;  --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --space-16: 64px;

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

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px rgba(0,0,0,0.04);

  /* Transitions */
  --transition:      all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 260px;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-app);
  color: var(--text-body);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { display:block; max-width:100%; }
a { text-decoration:none; color:inherit; transition:var(--transition); }
button { font-family:inherit; cursor:pointer; }
input, select, textarea { font-family:inherit; }

/* ── Typography ───────────────────────────────────────── */
h1,h2,h3,h4,h5 {
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-weight: 700; }
p  { color: var(--text-body); line-height: 1.7; }

/* ── Layout ───────────────────────────────────────────── */
.container        { max-width:1280px; margin:0 auto; padding:0 var(--space-8); width:100%; }
.container-narrow { max-width:860px;  margin:0 auto; padding:0 var(--space-8); }
.container-sm     { max-width:680px;  margin:0 auto; padding:0 var(--space-6); }
.section          { padding: var(--space-16) 0; }
.page-wrap        { padding: var(--space-10) 0 var(--space-16); }

/* ── Header / Nav ─────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-6);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(37,99,235,0.3);
  flex-shrink: 0;
}
.brand-text { color: var(--text-main); }
.brand-text span { color: var(--primary); }

.main-nav { display:flex; align-items:center; gap:var(--space-1); }
.nav-link {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color:var(--text-main); background:var(--bg-subtle); }
.nav-link.active { color:var(--primary); background:var(--primary-soft); }

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

/* User Menu */
.user-menu-wrap { position:relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-full);
  background: white;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  font-weight: 600;
}
.user-btn:hover { border-color:var(--primary); background:var(--primary-soft); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
}
.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  min-width: 220px;
  z-index: 2000;
  box-shadow: var(--shadow-xl);
}
.user-dropdown.open { display:block; }
.user-dropdown-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-2);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-body);
  transition: var(--transition);
}
.dropdown-item:hover { background:var(--bg-subtle); color:var(--text-main); }
.dropdown-item.danger { color:var(--danger); }
.dropdown-item.danger:hover { background:var(--danger-soft); }
.dropdown-item i { width:16px; height:16px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn i { width:16px; height:16px; }
.btn-sm  { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-xl  { padding: 15px 36px; font-size: 1.05rem; }
.btn-block { width:100%; justify-content:center; }
.btn-icon { padding: 8px; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 15px -3px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: white;
  border-color: var(--border-main);
  color: var(--text-body);
}
.btn-secondary:hover { background:var(--bg-subtle); border-color:var(--text-muted); }
.btn-ghost { background:transparent; color:var(--text-muted); }
.btn-ghost:hover { background:var(--bg-subtle); color:var(--text-main); }
.btn-success { background:var(--success); color:white; }
.btn-success:hover { background:#047857; box-shadow: 0 8px 15px -3px rgba(5,150,105,0.3); }
.btn-danger { background:var(--danger); color:white; }
.btn-danger:hover { background:#b91c1c; }
.btn-outline {
  background: transparent;
  border-color: var(--border-main);
  color: var(--text-body);
}
.btn-outline:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-soft); }

/* ── Cards / Surfaces ─────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-hover {
  transition: var(--transition);
  cursor: pointer;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-main);
}
.card-body  { padding: var(--space-6); }
.card-sm    { padding: var(--space-4); }
.card-lg    { padding: var(--space-8); }

/* Legacy surface aliases */
.surface        { background:var(--bg-surface); border:1px solid var(--border-light); border-radius:var(--radius-md); box-shadow:var(--shadow-sm); }
.surface-hover:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:var(--border-main); }

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-blue    { background:var(--primary-soft); color:var(--primary); }
.badge-green   { background:var(--success-soft); color:var(--success); }
.badge-yellow  { background:var(--warning-soft); color:var(--warning); }
.badge-red     { background:var(--danger-soft);  color:var(--danger); }
.badge-purple  { background:var(--purple-soft);  color:var(--purple); }
.badge-gray    { background:var(--bg-subtle);    color:var(--text-muted); }

/* ── Forms ────────────────────────────────────────────── */
.form-group   { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.form-input, .form-select {
  width: 100%;
  padding: 11px 14px;
  background: white;
  border: 1.5px solid var(--border-main);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
  appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-input.has-icon-left { padding-left: 42px; }
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
  pointer-events: none;
}

/* Legacy input aliases */
.input-group { margin-bottom: var(--space-5); }
.label { display:block; font-weight:700; font-size:0.78rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:var(--space-2); }
.input {
  width:100%; padding:11px 14px;
  background:white; border:1.5px solid var(--border-main);
  border-radius:var(--radius-sm); font-size:0.95rem; color:var(--text-main);
  transition:var(--transition);
}
.input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,0.12); }

/* ── Alerts ───────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  margin-bottom: var(--space-5);
}
.alert i { width:16px; height:16px; flex-shrink:0; margin-top:1px; }
.alert-error   { background:var(--danger-soft);  border-color:var(--danger-border);  color:#991b1b; }
.alert-success { background:var(--success-soft); border-color:var(--success-border); color:#065f46; }
.alert-warning { background:var(--warning-soft); border-color:var(--warning-border); color:#92400e; }
.alert-info    { background:var(--primary-soft); border-color:var(--primary-border); color:#1e40af; }

/* ── Tables ───────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  background: var(--bg-subtle);
  padding: 12px 20px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-main);
  white-space: nowrap;
}
.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover); }

/* Legacy aliases */
.table-container { border-radius:var(--radius-md); border:1px solid var(--border-light); overflow:hidden; background:white; }

/* ── Progress ─────────────────────────────────────────── */
.progress-track {
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

/* Legacy aliases */
.progress-bar-wrap { background:var(--bg-subtle); border-radius:var(--radius-full); height:6px; overflow:hidden; }
.progress-bar-fill { height:100%; border-radius:var(--radius-full); background:var(--primary); transition:width 0.5s ease; }
.progress-bar-fill.success { background:var(--success); }
.progress-bar-fill.danger  { background:var(--danger); }

/* ── Stat Card ────────────────────────────────────────── */
.stat-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: var(--shadow-xs);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.stat-value { font-size: 1.75rem; font-weight: 900; color: var(--text-main); line-height: 1; }

/* ── Misc Utilities ───────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-2  { gap: var(--space-2);  }
.gap-3  { gap: var(--space-3);  }
.gap-4  { gap: var(--space-4);  }
.gap-6  { gap: var(--space-6);  }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger);  }
.text-muted   { color: var(--text-muted); }
.text-sm  { font-size: 0.8rem; }
.text-xs  { font-size: 0.72rem; }
.fw-700   { font-weight: 700; }
.fw-800   { font-weight: 800; }
.fw-900   { font-weight: 900; }
.text-center { text-align: center; }
.mt-1 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-4); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: var(--space-4); }
.empty-state h3 { margin-bottom: var(--space-3); }
.empty-state p  { color: var(--text-muted); max-width: 380px; margin: 0 auto var(--space-6); }

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse   { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes spinCW  { to { transform: rotate(360deg); } }

.animate-fade { animation: fadeIn 0.4s ease forwards; }
.animate-slide-up { animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) forwards; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 var(--space-6); }
  .hide-md { display: none !important; }
}
@media (max-width: 768px) {
  .hide-sm { display: none !important; }
  .container { padding: 0 var(--space-4); }

  /* Mobile Flex Utilities */
  .flex-col-mobile {
    flex-direction: column !important;
    text-align: center !important;
    align-items: stretch !important;
  }
  .flex-col-mobile > * {
    width: 100% !important;
  }
  
  /* Mobile Grid Utilities */
  .grid-1-mobile {
    grid-template-columns: 1fr !important;
  }
  .grid-2-mobile {
    grid-template-columns: 1fr 1fr !important;
  }
  
  /* Helper for tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* Padding adjustments for mobile */
  .page-wrap { padding-top: var(--space-5) !important; padding-bottom: var(--space-10) !important; }
  .card { padding: var(--space-4) !important; }
}
