/* CBT Application - Premium Design System */
:root {
  --primary: #4F46E5; /* Indigo-600 */
  --primary-hover: #4338CA;
  --secondary: #6B7280; /* Gray-500 */
  --bg-color: #F9FAFB;
  --card-bg: #FFFFFF;
  --text-main: #111827;
  --text-muted: #4B5563;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.75rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Navbar */
.navbar {
  background: var(--card-bg);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

.btn {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-outline {
  border: 1px solid #D1D5DB;
  background: white;
  color: var(--text-muted);
}

.btn-outline:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
}

/* Auth Pages */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 100px);
}

.auth-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #D1D5DB;
  background: #F9FAFB;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background: white;
}

/* Dashboards & Listings */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #F3F4F6;
}

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

/* Exam UI */
.vignette-box {
  background: #EEF2FF;
  padding: 1.5rem;
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-style: italic;
  color: #3730A3;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  border-color: var(--primary);
  background: #F5F3FF;
}

.option-item input {
  margin-right: 1rem;
}

.option-item.selected {
  background: #EEF2FF;
  border-color: var(--primary);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary);
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
}

.table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}

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

.table tr:hover {
  background: #FAFBFF;
}

/* Utilities */
.text-center { text-align: center !important; }
.my-4 { margin: 1rem 0; }
.p-4 { padding: 1rem; }

/* Dashboard Sidebar Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #111827 url('../img/sidebar_bg.png') repeat;
  background-size: 320px;
  border-right: 1px solid #1F2937;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 50;
  padding: 1.5rem;
  overflow: hidden;
}

/* Semi-transparent dark overlay for sophisticated pattern blend */
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.94) 0%, rgba(15, 23, 42, 0.88) 100%);
  z-index: -1;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  background: var(--bg-color);
  min-height: 100vh;
}

.sidebar-logo {
  padding: 0.5rem 0.5rem 2.5rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
  text-decoration: none;
}

.sidebar-logo span {
  color: #94A3B8 !important;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.875rem 1.125rem;
  border-radius: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  color: #94A3B8;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  transform: translateX(4px);
}

.sidebar-link.active {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar-link.active i {
  color: #FFFFFF;
}

.sidebar-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: #64748B;
  transition: color 0.3s;
}

.sidebar-link:hover i, .sidebar-link.active i {
  color: #FFFFFF;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.5rem 0.75rem 0.5rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
