/* styles.css - Core Design System & Theme Styles for Gyankuriya Academy */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* HSL Color System */
  --primary-h: 243;
  --primary-s: 75%;
  --primary-l: 59%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
  --primary-dark: hsl(var(--primary-h), var(--primary-s), 45%);

  --accent-h: 175;
  --accent-s: 84%;
  --accent-l: 38%;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);
  --accent-dark: hsl(var(--accent-h), var(--accent-s), 30%);

  --success: hsl(142, 70%, 45%);
  --success-glow: hsla(142, 70%, 45%, 0.15);
  
  --danger: hsl(350, 80%, 55%);
  --danger-glow: hsla(350, 80%, 55%, 0.15);

  --warning: hsl(38, 92%, 50%);
  --warning-glow: hsla(38, 92%, 50%, 0.15);

  --info: hsl(200, 85%, 45%);

  /* Neutrals (Light Mode Base, Premium Contrast) */
  --bg: hsl(220, 20%, 97%);
  --bg-card: hsl(0, 0%, 100%);
  --border: hsl(220, 15%, 90%);
  --text: hsl(220, 30%, 15%);
  --text-muted: hsl(220, 15%, 50%);
  --shadow: 0 10px 30px rgba(79, 70, 229, 0.05);
  --shadow-lg: 0 20px 40px rgba(79, 70, 229, 0.08);

  /* Dark Slate Sidebar/Nav Override */
  --nav-bg: hsl(222, 47%, 12%);
  --nav-text: hsl(210, 40%, 98%);
  --nav-text-muted: hsl(215, 20%, 65%);

  /* Borders & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Header & Navigation */
header {
  background-color: var(--nav-bg);
  color: var(--nav-text);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span {
  background: linear-gradient(to right, #818cf8, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--nav-text-muted);
  cursor: pointer;
  position: relative;
  padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--nav-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background-color: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.08);
  color: var(--primary);
}

.btn-secondary:hover {
  background-color: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.12);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-glow);
}

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

.btn-danger:hover {
  background-color: hsl(350, 80%, 45%);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Common Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.5s ease forwards;
}

/* Landing Page Hero */
.hero {
  background: linear-gradient(135deg, hsl(222, 47%, 10%) 0%, hsl(222, 40%, 18%) 100%);
  color: white;
  padding: 100px 40px;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-text h1 {
  font-size: 48px;
  line-height: 1.15;
  margin-bottom: 20px;
  color: white;
}

.hero-text h1 span {
  background: linear-gradient(to right, #818cf8, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 18px;
  color: var(--nav-text-muted);
  margin-bottom: 36px;
  max-width: 600px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat-item h3 {
  font-size: 36px;
  color: #2dd4bf;
  margin-bottom: 4px;
}

.stat-item p {
  font-size: 14px;
  color: var(--nav-text-muted);
}

.hero-image-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.hero-badge-box {
  background-color: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--accent);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.hero-badge-box h4 {
  color: white;
  font-size: 15px;
  margin-bottom: 4px;
}

.hero-badge-box p {
  color: var(--nav-text-muted);
  font-size: 13px;
  margin: 0;
}

/* Exam Categories Grids */
.section-title {
  font-size: 28px;
  margin-bottom: 12px;
  position: relative;
  padding-left: 16px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: var(--radius-full);
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 16px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.category-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.jnv-box { background-color: rgba(79, 70, 229, 0.1); color: var(--primary); }
.upsc-box { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.ssc-box { background-color: rgba(13, 148, 136, 0.1); color: var(--accent); }
.bank-box { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.psc-box { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }
.ca-box { background-color: rgba(6, 182, 212, 0.1); color: var(--info); }

.category-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.category-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

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

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: fadeIn 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
}

.modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.modal-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  outline: none;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Student Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}

.metric-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-details p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-details h3 {
  font-size: 24px;
  font-weight: 800;
}

/* Performance Circular Graph Section */
.performance-overview {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 30px;
  margin-bottom: 40px;
}

.perf-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow);
}

.circle-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 200px;
}

.svg-ring-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
}

.svg-ring-wrapper svg {
  transform: rotate(-90deg);
}

.svg-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 12px;
}

.svg-ring-active {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12px;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440; /* will animate dynamically */
  transition: stroke-dashoffset 1s ease-out;
}

.svg-ring-active-teal {
  stroke: var(--accent);
}

.circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.circle-text h2 {
  font-size: 32px;
  font-weight: 800;
}

.circle-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Table styling */
.history-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  overflow: hidden;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 16px 20px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}

td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  text-transform: uppercase;
}

.success-badge { background-color: var(--success-glow); color: var(--success); }
.danger-badge { background-color: var(--danger-glow); color: var(--danger); }
.warning-badge { background-color: var(--warning-glow); color: var(--warning); }
.info-badge { background-color: rgba(6, 182, 212, 0.1); color: var(--info); }

.category-badge.jnv { background-color: rgba(79, 70, 229, 0.1); color: var(--primary); }
.category-badge.upsc { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.category-badge.ssc { background-color: rgba(13, 148, 136, 0.1); color: var(--accent); }
.category-badge.banking { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.category-badge.psc { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }
.category-badge.current_affairs { background-color: rgba(6, 182, 212, 0.1); color: var(--info); }

/* Play Test Config Modal Box */
.test-config-box h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.test-config-box p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.num-questions-select {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.num-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition);
}

.num-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-glow);
}

.num-card.active {
  border-color: var(--primary);
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 5px 15px var(--primary-glow);
}

/* Practice Exam Engine Layout */
.exam-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 99;
}

.exam-logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exam-logo-box h3 {
  font-size: 18px;
}

.timer-box {
  background-color: hsl(220, 20%, 94%);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.timer-box.timer-urgent {
  background-color: var(--danger-glow);
  color: var(--danger);
  border-color: var(--danger);
  animation: pulse 1s infinite;
}

.exam-body-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  min-height: calc(100vh - 73px);
}

.question-pane {
  background-color: var(--bg-card);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
}

.question-content h4 {
  font-size: 14px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.question-content p {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 30px;
  white-space: pre-line;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.option-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.option-card:hover {
  border-color: var(--primary);
  background-color: var(--primary-glow);
  transform: translateX(4px);
}

.option-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-glow);
  border-left: 5px solid var(--primary);
}

.option-prefix {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: hsl(220, 20%, 94%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.option-card.selected .option-prefix {
  background-color: var(--primary);
  color: white;
}

.option-text {
  font-size: 15px;
  font-weight: 500;
}

.pane-footer {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.action-group-left {
  display: flex;
  gap: 12px;
}

/* Sidebar question index palette */
.exam-sidebar {
  background-color: hsl(220, 20%, 96%);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-summary h4 {
  font-size: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.status-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.status-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.dot.answered, .nav-grid-btn.answered { background-color: var(--success); color: white; }
.dot.skipped, .nav-grid-btn.skipped { background-color: var(--danger); color: white; }
.dot.marked, .nav-grid-btn.marked { background-color: #8b5cf6; color: white; }
.dot.unvisited, .nav-grid-btn.unvisited { background-color: hsl(220, 15%, 85%); color: var(--text-muted); }

.palette-wrapper {
  margin-bottom: 40px;
}

.palette-wrapper h4 {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-grid-btn {
  height: 38px;
  border-radius: 6px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-grid-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.nav-grid-btn.active {
  border: 2px solid var(--text) !important;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Results Screen */
.results-header-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 20px 40px var(--primary-glow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.results-header-box h2 {
  color: white;
  font-size: 32px;
  margin-bottom: 8px;
}

.results-header-box p {
  color: var(--nav-text-muted);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.metric-box p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric-box h3 {
  font-size: 28px;
  font-weight: 800;
}

.res-youtube-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.video-iframe-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.video-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.review-section-heading {
  font-size: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.review-question-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border-left: 6px solid var(--border);
  transition: var(--transition);
}

.review-question-card.review-correct { border-left-color: var(--success); }
.review-question-card.review-incorrect { border-left-color: var(--danger); }
.review-question-card.review-skipped { border-left-color: var(--text-muted); }

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.review-number {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

.review-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.review-correct .review-status-badge { background-color: var(--success-glow); color: var(--success); }
.review-incorrect .review-status-badge { background-color: var(--danger-glow); color: var(--danger); }
.review-skipped .review-status-badge { background-color: hsl(220, 10%, 90%); color: var(--text-muted); }

.review-question-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 20px;
  white-space: pre-line;
}

.review-options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.review-option {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
}

.review-option.correct-opt {
  background-color: var(--success-glow);
  border-color: var(--success);
}

.review-option.incorrect-opt {
  background-color: var(--danger-glow);
  border-color: var(--danger);
}

.review-explanation-box {
  background-color: hsl(220, 20%, 96%);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 14px;
  margin-bottom: 20px;
}

.review-explanation-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
}

/* AI Doubt Clearance Chat Widget styling */
.review-ai-doubt-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.ai-inline-chatbox {
  background-color: hsl(220, 25%, 97%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}

.ai-chat-header {
  background-color: var(--nav-bg);
  color: white;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.ai-chat-messages {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
}

.ai-msg.bot {
  background-color: white;
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.ai-msg.user {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-msg.bot.thinking {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: bold;
  padding: 4px 14px;
}

.ai-chat-input-wrapper {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  background-color: white;
}

.ai-chat-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 8px;
}

/* PDF Study Notes Catalog */
.notes-header {
  text-align: center;
  margin-bottom: 40px;
}

.pdf-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.pdf-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: var(--transition);
}

.pdf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.pdf-icon-box {
  width: 60px;
  height: 60px;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.pdf-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pdf-info h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.pdf-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pdf-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Lectures portal */
.lectures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.lecture-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.lecture-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.lecture-thumbnail-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background-color: hsl(220, 20%, 90%);
}

.lecture-thumbnail-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.lecture-content {
  padding: 20px;
}

.lecture-content h3 {
  font-size: 16px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.lecture-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Admin Dashboard layout */
.admin-tab-nav {
  display: flex;
  gap: 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 30px;
}

.admin-tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-pane {
  display: none;
}

.admin-pane.active {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.batch-import-template {
  background-color: hsl(220, 20%, 95%);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: monospace;
  font-size: 11px;
  white-space: pre-wrap;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Dot pulse animations for chat bubble thinking */
.dot-pulse-1 { animation: pulseAnim 1.2s infinite; animation-delay: 0s; }
.dot-pulse-2 { animation: pulseAnim 1.2s infinite; animation-delay: 0.2s; }
.dot-pulse-3 { animation: pulseAnim 1.2s infinite; animation-delay: 0.4s; }

@keyframes pulseAnim {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* Text Center Helper */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Responsive Adjustments */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .exam-body-grid {
    grid-template-columns: 1fr;
  }
  .question-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .performance-overview {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  header {
    padding: 16px 20px;
  }
  nav {
    display: none; /* simple hamburger fallback or toggle needed */
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .results-header-box {
    padding: 24px;
  }
  .results-header-box h2 {
    font-size: 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
