/* ==========================================================================
   DVCODE DESIGN SYSTEM & PREMIUM VISUAL STYLING
   Glassmorphism, 3D Keyframe Animations, Sticky Controls, and Neon Accents
   ========================================================================== */

:root {
  /* Premium Dark Theme Color Space (Cosmos Slate) */
  --bg: #030712;
  --bg-gradient: radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.15), transparent 45%),
                 linear-gradient(135deg, #030712, #0b1329 55%, #020617);
  --panel: rgba(15, 23, 42, 0.45);
  --panel-solid: #0f172a;
  --text: #f1f5f9;
  --muted: #64748b;
  --line: rgba(56, 189, 248, 0.15);
  --line-strong: rgba(56, 189, 248, 0.3);
  
  /* Glowing Neon Accents */
  --brand: #10b981;
  --brand-glow: rgba(16, 185, 129, 0.25);
  --brand2: #38bdf8;
  --brand2-glow: rgba(56, 189, 248, 0.35);
  
  --easy: #10b981;
  --easy-border: rgba(16, 185, 129, 0.3);
  --easy-bg: rgba(16, 185, 129, 0.06);
  
  --med: #f59e0b;
  --med-border: rgba(245, 158, 11, 0.3);
  --med-bg: rgba(245, 158, 11, 0.06);
  
  --hard: #f43f5e;
  --hard-border: rgba(244, 63, 94, 0.3);
  --hard-bg: rgba(244, 63, 94, 0.06);
  
  /* Shimmer / Skeleton screen */
  --shimmer: linear-gradient(90deg, rgba(30, 41, 59, 0.1) 0%, rgba(56, 189, 248, 0.12) 50%, rgba(30, 41, 59, 0.1) 100%);
}

.hidden {
  display: none !important;
}

/* ==========================================
   RESET & SYSTEM BASE STYLING
   ========================================== */

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.2) transparent;
}

html, body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg-gradient);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  letter-spacing: -0.1px;
}

/* Customized Premium Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.18);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.4);
}

#three-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================
   SIDEBAR LAYOUT & CIRCULAR PROGRESS METERS
   ========================================== */

.sidebar {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  padding: 24px;
  background: rgba(8, 14, 28, 0.85);
  border-right: 1px solid rgba(56, 189, 248, 0.18);
  position: relative;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  box-shadow: 20px 0 80px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.hero-art {
  height: 110px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.1);
  position: relative;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.15) contrast(1.08);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand2), #0284c7);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #04111f;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.brand p, .note {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* SVG Circular Progress & Statistics */
.stats-container {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
}

.progress-circle-wrap {
  position: relative;
  width: 76px;
  height: 76px;
}

.progress-ring {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring__circle {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
}

.progress-percentage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.stats-numerical {
  flex: 1;
}

.stats-numerical h4 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stats-numerical-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 14px;
}

.stats-numerical-row span {
  font-weight: 800;
  color: #fff;
}

.stats-numerical-row small {
  color: var(--brand2);
  font-weight: 700;
}

/* ==========================================
   INPUTS, SELECTION CONTROLS, AND BUTTONS
   ========================================== */

label {
  display: block;
  margin: 14px 0 6px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input, select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #020617;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, select:focus {
  border-color: var(--brand2);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto; /* Push to bottom of sidebar */
  padding-top: 20px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--brand2), #0284c7);
  color: #04111f;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

button:hover {
  filter: brightness(1.1);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}

button:active {
  transform: translateY(1px);
}

button.ghost, .tab {
  background: rgba(30, 41, 59, 0.4);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: var(--line-strong);
  color: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

/* ==========================================
   MAIN APP BODY & SCROLLABLE VIEWPORTS
   ========================================== */

main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.topbar {
  height: 92px;
  min-height: 92px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 3;
}

.topbar h2 {
  margin: 0;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: #fff;
}

.topbar p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

nav {
  display: flex;
  gap: 10px;
}

.tab {
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.active {
  background: linear-gradient(135deg, var(--brand2), #0284c7);
  color: #04111f;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

.layout {
  display: grid;
  grid-template-columns: minmax(380px, 35%) 1fr;
  height: calc(100vh - 92px);
  max-height: calc(100vh - 92px);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

/* ==========================================
   QUESTION LIST VIEW & GLOWING HOVERS
   ========================================== */

.list {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 20px;
  background: rgba(8, 14, 28, 0.15);
}

.qitem {
  padding: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.72));
  border-radius: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s ease;
  overflow: hidden;
}

.qitem:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(18, 32, 51, 0.6);
  transform: translateY(-2.5px);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.08);
}

/* Glowing Indicator bar on Active Selection */
.qitem.active {
  border-color: var(--brand2);
  background: rgba(18, 32, 51, 0.85);
  box-shadow: 0 12px 35px rgba(56, 189, 248, 0.14);
}

.qitem.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--brand2), #0284c7);
  border-radius: 4px 0 0 4px;
  box-shadow: 2px 0 15px var(--brand2);
}

.qtop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.qid {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.Easy { color: var(--easy); border-color: var(--easy-border); background: var(--easy-bg); }
.Medium { color: var(--med); border-color: var(--med-border); background: var(--med-bg); }
.Hard { color: var(--hard); border-color: var(--hard-border); background: var(--hard-bg); }

.qtitle {
  font-weight: 700;
  line-height: 1.45;
  font-size: 15px;
  color: #fff;
}

.qmeta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.solved {
  color: var(--brand);
  font-weight: 800;
  text-shadow: 0 0 10px var(--brand-glow);
}

/* ==========================================================
   📌 STICKY GLASSMORPHIC DETAIL PANE HEADER (UX REVOLUTION)
   ========================================================== */

.detail {
  min-height: 0;
  height: 100%;
  padding: 0; /* Remove parent padding to allow full bleed sticky headers */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: rgba(3, 7, 18, 0.1);
  position: relative;
  scroll-behavior: smooth;
}

.detail-content-wrap {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-header-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.detail-header-sticky h2 {
  margin: 6px 0 0 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  line-height: 1.35;
}

.detail-header-sticky .qtop {
  margin-bottom: 6px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.toolbar button {
  font-size: 13px;
  padding: 10px 16px;
}

.question {
  font-size: 16px;
  line-height: 1.6;
  background: #020617;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 16px;
  margin-top: 10px;
  font-weight: 600;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
  border-left: 3px solid var(--brand2);
}

.answer {
  line-height: 1.75;
  color: #cbd5e1;
}

.reveal {
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.empty {
  color: var(--muted);
  padding: 80px 40px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: auto;
}

.empty svg {
  stroke: var(--brand2);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ==========================================================
   🔄 3D CARD PERSPECTIVE FLIPPER (FLASHCARD MODE)
   ========================================================== */

.panel {
  margin: 32px;
  max-width: 900px;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  margin-top: 0;
  font-size: 26px;
}

.panel p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 0;
  margin-bottom: 24px;
}

/* Perspective viewport */
.flip-card-container {
  perspective: 1200px;
  width: 100%;
  margin: 24px 0;
}

/* Inner flipper object */
.flip-card-inner {
  position: relative;
  width: 100%;
  min-height: 380px;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Click state triggers 3D turn */
.flip-card-container.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* Faces base styling */
.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow-y: auto;
}

/* Front Face */
.flip-card-front {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.88));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Back Face */
.flip-card-back {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.95));
  transform: rotateY(180deg); /* Oriented flipped */
}

/* ==========================================================
   ⚡ ELEGANT SKELETON SHIMMER LOADERS
   ========================================================== */

.shimmer-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: 14px;
}

.shimmer-element {
  background: #1e293b;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.shimmer-element::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.08), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.shimmer-title { height: 28px; width: 45%; }
.shimmer-text-long { height: 16px; width: 100%; }
.shimmer-text-med { height: 16px; width: 85%; }
.shimmer-text-short { height: 16px; width: 60%; }
.shimmer-diagram { height: 160px; width: 100%; border-radius: 12px; margin-top: 8px;}

/* ==========================================================
   📝 MARKDOWN STYLING SUITE
   ========================================================== */

.answer h1 {
  font-size: 22px;
  color: #fff;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin-top: 36px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

.answer h2 {
  font-size: 18px;
  color: var(--brand2);
  margin-top: 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

.answer h3 {
  font-size: 15px;
  color: var(--easy);
  margin-top: 24px;
  font-weight: 700;
}

.answer p {
  margin: 14px 0;
  font-size: 15px;
  line-height: 1.75;
}

/* Premium Blockquotes for First-Person Answers */
.answer blockquote {
  border-left: 4px solid var(--brand);
  background: rgba(16, 185, 129, 0.08);
  padding: 18px 22px;
  margin: 22px 0;
  border-radius: 0 16px 16px 0;
  font-style: italic;
  color: #f1f5f9;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.answer blockquote p {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
}

.answer ul, .answer ol {
  padding-left: 24px;
  margin: 14px 0;
}

.answer li {
  margin-bottom: 8px;
  font-size: 15px;
}

/* Premium Grid Tables */
.answer table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.answer th, .answer td {
  border: 1px solid var(--line);
  padding: 12px 18px;
  text-align: left;
}

.answer th {
  background-color: rgba(56, 189, 248, 0.12);
  color: var(--brand2);
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

.answer tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Code Highlighting Core styles */
.answer pre {
  margin: 24px 0 !important;
  border-radius: 14px !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

.answer code {
  background: rgba(56, 189, 248, 0.1);
  color: var(--brand2);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.answer pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}

/* Mermaid Rendering container */
.mermaid {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Keyboard shortcut helpers */
.shortcuts-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.shortcuts-footer span {
  display: inline-flex;
  gap: 4px;
}

/* Mobile actions row layout */
.actions-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 12px;
  width: 100%;
}

.mock-list li {
  margin: 14px 0;
  padding: 16px;
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 14px;
  line-height: 1.5;
}

.panel {
  flex: 1;
  min-height: 0;
  height: calc(100vh - 92px);
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 32px 40px;
}

/* Star Bookmark Button */
.star-btn {
  background: transparent !important;
  border: none !important;
  color: #475569 !important;
  font-size: 16px !important;
  padding: 4px 6px !important;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease !important;
  line-height: 1 !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.star-btn:hover {
  color: #fbbf24 !important;
  transform: scale(1.2) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.star-btn.starred {
  color: #fbbf24 !important;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.starred-btn {
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
}

/* Dual Filter Row */
.filter-row-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Candidate Notes Panel */
.candidate-notes-box {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.candidate-notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #94a3b8;
}

.notes-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand);
  border: 1px solid rgba(16, 185, 129, 0.25);
  transition: opacity 0.3s ease;
}

.candidate-notes-box textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  background: #020617;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 12px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  outline: none;
  box-sizing: border-box;
}

.candidate-notes-box textarea:focus {
  border-color: var(--brand2);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Code Copy Button */
.code-block-wrap {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #94a3b8;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
  box-shadow: none;
}

.code-copy-btn:hover {
  color: #fff;
  border-color: var(--brand2);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: none;
  transform: none;
}

.code-copy-btn.copied {
  color: var(--brand);
  border-color: var(--brand);
}

/* Backup Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #0b1329;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  position: relative;
}

.modal-card h3 {
  margin: 0 0 8px 0;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
}

.modal-card p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent !important;
  border: none !important;
  color: var(--muted) !important;
  font-size: 20px !important;
  cursor: pointer;
  padding: 4px 8px !important;
  box-shadow: none !important;
}

.modal-close:hover {
  color: #fff !important;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mock Interview Controls */
.mock-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 20px 0 24px 0;
  background: rgba(15, 23, 42, 0.6);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.mock-track-select {
  flex: 1;
  min-width: 260px;
}

.mock-timer-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #020617;
  padding: 8px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.mock-timer-display {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Fira Code', monospace;
  color: var(--brand2);
  min-width: 75px;
  text-align: center;
}

.mock-timer-btn {
  padding: 8px 14px;
  font-size: 12px;
}

.flashcard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.easy-pill {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--brand) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.hard-pill {
  background: rgba(244, 63, 94, 0.15) !important;
  color: var(--hard) !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

/* ==========================================================
   💎 MONETIZATION & PRO TIER DESIGN SYSTEM
   ========================================================== */

.pro-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #030712;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.free-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.pro-pill-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #030712 !important;
  font-weight: 900 !important;
  font-size: 13px !important;
  padding: 9px 18px !important;
  border-radius: 12px !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3) !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pro-pill-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.5) !important;
}

.pro-pill-btn.active-pro {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: none !important;
}

/* Glassmorphic Pro Paywall Teaser */
.pro-paywall-card {
  position: relative;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(8, 14, 28, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(245, 158, 11, 0.05);
  margin-top: 20px;
}

.pro-paywall-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.08), transparent 70%);
  pointer-events: none;
}

.pro-lock-icon {
  width: 60px;
  height: 60px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.pro-paywall-card h3 {
  color: #fff;
  font-size: 22px;
  margin: 0 0 8px 0;
  font-family: 'Outfit', sans-serif;
}

.pro-paywall-card p.pro-tagline {
  color: #94a3b8;
  font-size: 14px;
  max-width: 520px;
  margin: 0 auto 24px;
  line-height: 1.55;
}

.pro-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-width: 650px;
  margin: 0 auto 28px;
  text-align: left;
}

.pro-feature-item {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pro-feature-item span.icon {
  color: #f59e0b;
  font-size: 15px;
}

/* Pricing Modal */
.pricing-modal-card {
  max-width: 860px !important;
  padding: 36px 40px !important;
}

.pricing-header {
  text-align: center;
  margin-bottom: 28px;
}

.pricing-header h2 {
  font-size: 28px;
  color: #fff;
  margin: 0 0 8px 0;
  font-family: 'Outfit', sans-serif;
}

.pricing-header p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.currency-toggle-wrap {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 28px;
}

.currency-btn {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.plan-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
}

.plan-card.featured {
  background: linear-gradient(145deg, rgba(18, 32, 51, 0.95), rgba(11, 20, 36, 0.9));
  border: 1.5px solid #f59e0b;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.15);
}

.featured-pill {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #030712;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.plan-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.plan-price {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  margin: 12px 0 4px;
}

.plan-price small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.plan-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  font-size: 13px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan-features li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.plan-features li::before {
  content: '✓';
  color: var(--brand);
  font-weight: 900;
}

/* Cheatsheets Gallery */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.cheatsheet-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.cheatsheet-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand2);
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.12);
}

.cheatsheet-icon {
  width: 52px;
  height: 52px;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--brand2);
}

.cheatsheet-card h3 {
  margin: 0 0 8px 0;
  color: #fff;
  font-size: 18px;
}

.cheatsheet-card p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 20px 0;
  flex: 1;
}

/* Mobile Base Styles */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(8, 14, 28, 0.95);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.mobile-filter-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--line);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.mobile-sidebar-close {
  display: none;
  background: rgba(244, 63, 94, 0.15) !important;
  color: var(--hard) !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  width: 100%;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  z-index: 45;
}

.mobile-back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--line);
  color: var(--brand2);
  cursor: pointer;
  width: fit-content;
}

/* ==========================================
   RESPONSIVE DESIGN SYSTEM (MOBILE OPTIMIZED)
   ========================================== */

@media (max-width: 992px) {
  html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  /* Slide-Out Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 50;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.85);
    background: #080e1c;
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .mobile-sidebar-close {
    display: block;
  }

  main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    min-height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex-shrink: 0;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .topbar p {
    font-size: 12px;
  }

  /* Horizontal touch-scrollable tabs */
  .topbar nav {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    display: flex;
    gap: 8px;
  }

  .topbar nav::-webkit-scrollbar {
    display: none;
  }

  .tab {
    padding: 8px 14px;
    font-size: 12.5px;
    flex-shrink: 0;
  }

  .pro-pill-btn {
    padding: 8px 14px !important;
    font-size: 12px !important;
    flex-shrink: 0;
  }

  /* Mobile Master-Detail Flow */
  .layout {
    display: flex;
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  .list {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-right: none;
    padding: 14px;
    flex-shrink: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #030712;
    z-index: 10;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail.mobile-active {
    display: flex;
  }

  .mobile-back-btn {
    display: inline-flex;
  }

  .detail-header-sticky {
    padding: 16px;
  }

  .detail-header-sticky h2 {
    font-size: 18px;
  }

  .detail-content-wrap {
    padding: 16px;
  }

  .answer {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .answer table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .answer pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Pricing Modal Mobile Optimization */
  .pricing-modal-card {
    padding: 24px 20px !important;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Mock Controls Mobile Stack */
  .mock-controls-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }

  .mock-timer-wrap {
    justify-content: space-between;
  }

  /* Cheatsheets Mobile Stack */
  .cheatsheet-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px 16px;
    margin: 0;
    width: 100%;
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Flashcard sizing on mobile */
  .flip-card-container {
    height: 380px;
  }

  .actions-row {
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 8px;
  }

  .actions-row button {
    padding: 10px 8px;
    font-size: 12.5px;
  }
}
