/* ============================================================
   BACKEND INTERVIEW PREP — Main Stylesheet
   ============================================================ */

:root {
  --bg-primary: #111111;
  --bg-secondary: #1a1a1a;
  --bg-card: #1c1c1c;
  --bg-card-hover: #222222;
  --border: #2e2e2e;
  --border-light: #383838;
  --text-primary: #ebebeb;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent: #5b6af0;
  --accent-hover: #6e7cf5;
  --accent-glow: rgba(91, 106, 240, 0.12);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: 0.15s ease;
}

[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --border: #e0e0e0;
  --border-light: #ebebeb;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --accent: #4a58e0;
  --accent-hover: #5b6af0;
  --accent-glow: rgba(74, 88, 224, 0.08);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  color: var(--accent-hover);
}

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

.container--wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

[data-theme="light"] .navbar {
  background: rgba(245, 245, 245, 0.92);
}

.navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.navbar__logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.navbar__nav {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.navbar__nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all var(--transition);
}

.navbar__nav a:hover,
.navbar__nav a.active {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ---- Hero ---- */
.hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  display: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent-hover);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero__title {
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero__companies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.company-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: default;
}

.company-badge:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  transform: translateY(-2px);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat__number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat__label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Section ---- */
.section {
  padding: 4rem 1.5rem;
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section__title {
  margin-bottom: 0.75rem;
}

.section__desc {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Progress Bar ---- */
.progress-bar-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-bar-track {
  background: var(--border);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ---- Month Cards ---- */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.month-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.month-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.month-card.completed {
  border-color: var(--success);
}

.month-card__header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.month-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.month-card__meta {
  flex: 1;
  min-width: 0;
}

.month-card__number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.month-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.month-card__theme {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.month-card__checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}

.month-card.completed .month-card__checkbox {
  background: var(--success);
  border-color: var(--success);
}

.month-card__body {
  padding: 1.25rem 1.5rem;
}

.month-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.topic-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
}

.month-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.month-card__expand {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Detail Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal__close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}

.modal__close:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.modal__body {
  padding: 2rem;
}

.topic-section {
  margin-bottom: 1.75rem;
}

.topic-section__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.topic-section__title::before {
  content: '';
  width: 3px;
  height: 1em;
  border-radius: 2px;
  background: var(--accent);
  display: block;
}

.subtopic-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.subtopic-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background var(--transition);
}

.subtopic-list li:hover {
  background: var(--bg-secondary);
}

.subtopic-list li::before {
  content: '→';
  color: var(--accent);
  font-size: 0.75rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.milestones-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.milestones-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.milestones-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.leetcode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.leetcode-tag {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
}

.week-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.week-schedule-item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

/* ---- Companies Section ---- */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.company-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
}

.company-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.company-card__logo {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.company-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.company-card__rounds {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.company-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.focus-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-secondary);
}

/* ---- Resources ---- */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.resource-card__priority {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.priority-must { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.priority-recommended { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.priority-deep { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.priority-daily { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.priority-weekly { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.priority-monthly { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.resource-card__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.resource-card__author {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ---- Practice Quiz ---- */
.practice-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.practice-section__title {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.q-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.q-card:hover {
  border-color: var(--accent);
}

.q-card__question {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.q-card__answer {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: none;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
}

.q-card.revealed .q-card__answer {
  display: block;
}

.q-card__tags {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.q-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.q-tag--easy { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.q-tag--medium { background: rgba(234, 179, 8, 0.15); color: #f59e0b; }
.q-tag--hard { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.q-tag--topic { background: var(--accent-glow); color: var(--accent-hover); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

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

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

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 0.375rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }

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

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Timeline View ---- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.timeline-item.active::before,
.timeline-item:hover::before {
  border-color: var(--accent);
  background: var(--accent);
}

/* ---- Footer ---- */
.footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer a { color: var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar__nav { display: none; }
  .hero__stats { gap: 1.5rem; }
  .roadmap-grid { grid-template-columns: 1fr; }
  .companies-grid { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .modal { max-height: 100vh; border-radius: 0; }
}

/* ---- Scroll animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Floating progress ---- */
.floating-progress {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  z-index: 50;
  min-width: 200px;
  display: none;
}

.floating-progress.visible {
  display: block;
}

.floating-progress__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.floating-progress__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ---- Search bar ---- */
.search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  padding: 12px 16px 12px 44px;
  outline: none;
  transition: all var(--transition);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ---- Notification toast ---- */
.toast {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  z-index: 300;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow);
}

.toast.show { transform: translateX(0); }
