/* ==========================================================================
   ExamCracker AI - Module Specific Views & Dashboard Layouts
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Command Center / Dashboard
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '🎯';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 5rem;
  opacity: 0.15;
  pointer-events: none;
}

.welcome-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 20px;
}

.quick-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   2. Syllabus Uploader & AI Extractor
   -------------------------------------------------------------------------- */
.syllabus-upload-zone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  background: rgba(99, 102, 241, 0.03);
  transition: all var(--transition-normal);
  cursor: pointer;
  margin-bottom: 28px;
}

.syllabus-upload-zone:hover, .syllabus-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
}

.upload-icon-large {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: inline-block;
}

.upload-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* AI Pipeline Step Tracker */
.pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.step-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.pipeline-step.active {
  color: #fff;
  font-weight: 600;
}

.pipeline-step.active .step-indicator {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary);
  animation: pulse 1.5s infinite;
}

.pipeline-step.completed {
  color: var(--emerald-green);
}

.pipeline-step.completed .step-indicator {
  background: var(--emerald-green);
  color: #fff;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Knowledge Tree */
.knowledge-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tree-subject-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition-fast);
}

.tree-subject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.subject-name-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-icon {
  font-size: 1.2rem;
}

.subject-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.topics-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.topic-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   3. Weak Area Detector & Heatmap
   -------------------------------------------------------------------------- */
.weakness-heatmap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.score-bleed-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.bleed-stat {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--crimson-alert);
  margin: 10px 0 4px;
}

.accuracy-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.accuracy-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* --------------------------------------------------------------------------
   4. 3D-Flip AI Flashcards Engine
   -------------------------------------------------------------------------- */
.flashcards-container {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-scene {
  width: 100%;
  height: 380px;
  perspective: 1000px;
  margin: 24px 0;
  cursor: pointer;
}

.flashcard-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg);
}

.flashcard-3d.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.card-face-front {
  background: linear-gradient(145deg, #131b2e 0%, #0b1120 100%);
}

.card-face-back {
  background: linear-gradient(145deg, #171b30 0%, #0d1226 100%);
  transform: rotateY(180deg);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-flip-prompt {
  align-self: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-content-body {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
}

.card-mnemonic-box {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--amber-gold);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #fef3c7;
  margin-top: 12px;
}

/* Leitner Rating Controls */
.leitner-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}

.btn-rating {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rating-again { background: rgba(244, 63, 94, 0.1); color: #fb7185; border-color: rgba(244, 63, 94, 0.3); }
.rating-again:hover { background: var(--crimson-alert); color: #fff; }

.rating-hard { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.rating-hard:hover { background: var(--amber-gold); color: #fff; }

.rating-good { background: rgba(6, 182, 212, 0.1); color: #38bdf8; border-color: rgba(6, 182, 212, 0.3); }
.rating-good:hover { background: var(--cyber-cyan); color: #fff; }

.rating-easy { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.rating-easy:hover { background: var(--emerald-green); color: #fff; }

/* --------------------------------------------------------------------------
   5. AI Doubt Solver ("CrackerBot")
   -------------------------------------------------------------------------- */
.doubt-solver-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: calc(100vh - var(--header-height) - 64px);
}

.chat-history-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chat-messages-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages-stream {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-msg {
  display: flex;
  gap: 14px;
  max-width: 82%;
}

.chat-msg.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.ai-msg {
  align-self: flex-start;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-msg .msg-avatar {
  background: linear-gradient(135deg, var(--primary), var(--cyber-cyan));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.user-msg .msg-avatar {
  background: #334155;
  color: #fff;
}

.msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.user-msg .msg-bubble {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.chat-input-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #fff;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

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

/* --------------------------------------------------------------------------
   6. AI Day-by-Day Study Planner
   -------------------------------------------------------------------------- */
.planner-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.planner-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.planner-day-card.today {
  border-color: var(--primary);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.day-badge {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.day-badge span {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. Group Study Rooms & Aspirant Leaderboard
   -------------------------------------------------------------------------- */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.room-participants {
  display: flex;
  align-items: center;
  gap: -8px;
}

.peer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 700;
  margin-left: -8px;
}

.peer-avatar:first-child {
  margin-left: 0;
}

/* Leaderboard Table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.rank-number {
  font-family: var(--font-heading);
  font-weight: 800;
  width: 36px;
}

.rank-1 { color: #facc15; }
.rank-2 { color: #cbd5e1; }
.rank-3 { color: #d97706; }

/* --------------------------------------------------------------------------
   8. Pricing / Monetization Tiers
   -------------------------------------------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform var(--transition-normal);
}

.pricing-card.featured {
  border-color: var(--primary);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: linear-gradient(90deg, var(--primary), var(--purple-accent));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}

.pricing-price {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin: 16px 0 8px;
}

.pricing-price span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pricing-features li.included {
  color: var(--text-main);
}
