/* ============================================
   TCS NQT DSA – Professional Style
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #0f172a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(59, 130, 246, 0.4);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
  --navbar-h: 68px;
  --filter-h: 60px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8edf8;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --border: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(59, 130, 246, 0.3);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-glow: rgba(59, 130, 246, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100%;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  display: flex;
  flex-direction: column;
}

/* Footer sticks to bottom — no blank space after it */
.footer {
  margin-top: auto;
  flex-shrink: 0;
}

/* Questions section grows to fill empty space above footer */
.questions-section {
  flex: 1 0 auto;
}

/* Everything else does not grow */
.navbar, .filter-bar, .hero,
.testimonials-section, .feedback-section {
  flex-shrink: 0;
}

/* ---- Background mesh on html to avoid flex/stacking interference ---- */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(59,130,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(99,102,241,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* canvas sits outside flow */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  flex-shrink: 0;
}

/* ============== NAVBAR ============== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  background: #0a0f1e;
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

body.light-mode .navbar {
  background: #eef2fc;
}

.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.logo {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-accent {
  color: var(--accent);
}

.logo-img {
  width: 36px;
  height: 32px;
  object-fit: contain;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar-mini {
  width: 80px;
  height: 5px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: 100px;
  width: 0%;
  transition: width 0.6s ease;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Visitor count pill */
.visitor-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: default;
  white-space: nowrap;
}

.visitor-pill i {
  font-size: 12px;
  color: #22c55e;
}

.visitor-pill:hover {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

/* Retention pill — amber accent */
.retention-pill i {
  color: #f59e0b;
}

.retention-pill:hover {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ============== FILTER BAR ============== */
.filter-bar {
  position: sticky;
  top: var(--navbar-h);
  z-index: 100;
  background: #0c1220;
  border-bottom: 1px solid var(--border);
  padding: 10px 5%;
}

body.light-mode .filter-bar {
  background: #eef2fc;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Custom Select Dropdown ---- */
.custom-select {
  position: relative;
  flex-shrink: 0;
}

.custom-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  outline: none;
  -webkit-text-fill-color: var(--text-primary);
}

.custom-select-btn i:first-child {
  color: var(--text-muted);
  font-size: 13px;
}

.custom-select-btn .caret {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 2px;
  transition: transform var(--transition);
}

.custom-select.open .caret {
  transform: rotate(180deg);
}

.custom-select-btn:hover,
.custom-select.open .custom-select-btn {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.custom-select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: #1a2640;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 6px;
  list-style: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  animation: dropDown 0.15s ease;
}

body.light-mode .custom-select-list {
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.custom-select.open .custom-select-list {
  display: block;
}

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.custom-select-list li {
  padding: 10px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  user-select: none;
}

body.light-mode .custom-select-list li {
  color: #334155;
}

.custom-select-list li:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.custom-select-list li.active {
  background: rgba(59, 130, 246, 0.18);
  color: var(--accent);
  font-weight: 600;
}

/* ---- Search box ---- */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  flex: 1;
  min-width: 180px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  z-index: 10;
  isolation: isolate;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-icon {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  pointer-events: none;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  pointer-events: auto;
  -webkit-text-fill-color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

/* ============== HERO ============== */
.hero {
  padding: calc(var(--navbar-h) + 60px) 5% 60px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #818cf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 36px;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 28px;
  gap: 28px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ============== QUESTIONS SECTION ============== */
.questions-section {
  padding: 10px 5% 60px;
}

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

.section-header.centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 40px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  padding: 4px 12px;
  border-radius: 100px;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
}

/* ============== QUESTIONS GRID ============== */
.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.loader-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

/* ============== SKELETON CARDS ============== */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  overflow: hidden;
}

/* Every grey block inside the card */
.sk {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite linear;
}

body.light-mode .sk {
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.05) 25%,
    rgba(0,0,0,0.12) 50%,
    rgba(0,0,0,0.05) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite linear;
}

/* Row for badge + tick at the top */
.sk-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sk-badge {
  width: 58px;
  height: 22px;
  border-radius: 100px;
}

.sk-tick {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Title lines */
.sk-title-1 {
  height: 18px;
  width: 85%;
  margin-bottom: 8px;
}

.sk-title-2 {
  height: 18px;
  width: 55%;
  margin-bottom: 14px;
}

/* Category row */
.sk-category {
  height: 13px;
  width: 40%;
}

/* ============== CARD ============== */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  overflow: hidden;
  opacity: 0;
  animation: cardIn 0.35s ease forwards;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius);
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 0 1px var(--border-accent);
}

.card:hover::before {
  opacity: 1;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.card-category {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.easy {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.medium {
  background: rgba(250, 204, 21, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.hard {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ---- Done tick ---- */
.done-tick {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  z-index: 2;
}

.done-tick:hover {
  border-color: var(--green);
  color: var(--green);
}

.done-tick.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ============== LOADER ============== */
.loader {
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============== TESTIMONIALS ============== */
.testimonials-section {
  padding: 80px 5%;
  overflow: hidden;
}

.carousel-wrapper {
  overflow: hidden;
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0;
}

.testimonial-card {
  min-width: 380px;
  max-width: 380px;
  flex-shrink: 0;
  margin: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  font-size: 72px;
  position: absolute;
  top: 10px;
  left: 20px;
  color: var(--accent);
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 20px;
  margin-bottom: 20px;
}

.testimonial-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.testimonial-author .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.testimonial-author-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.testimonial-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 100px;
  background: var(--border);
  transition: all var(--transition);
  cursor: pointer;
}

.dot.active {
  width: 20px;
  background: var(--accent);
}

/* ============== FEEDBACK ============== */
.feedback-section {
  padding: 60px 5% 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.feedback-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px;
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.feedback-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 8px 0 28px;
}

#feedbackForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.textarea-icon {
  top: 16px;
  align-self: flex-start;
}

#feedbackForm input,
#feedbackForm textarea {
  width: 100%;
  padding: 13px 16px 13px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  outline: none;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  transition: border var(--transition), box-shadow var(--transition);
}

#feedbackForm input:focus,
#feedbackForm textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.textarea-wrapper {
  flex-direction: column;
  align-items: flex-start;
}

.textarea-wrapper textarea {
  resize: vertical;
  min-height: 110px;
}

.char-count {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.submit-btn {
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  width: 100%;
}

.submit-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.submit-btn:active {
  transform: translateY(0);
}

#feedbackMessage {
  margin-top: 12px;
  font-size: 14px;
  color: #4ade80;
  text-align: center;
  font-weight: 500;
  min-height: 20px;
}

/* ============== FOOTER ============== */
.footer {
  padding: 28px 5% 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

body.light-mode .footer {
  background: rgba(200, 210, 230, 0.3);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 32px;
  height: 28px;
  object-fit: contain;
  opacity: 0.7;
}

.footer-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.footer-tagline {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  gap: 4px;
}

.footer-right a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 17px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.footer-right a:hover {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-glow);
}

.footer-bottom {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============== MODAL ============== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10000;
  padding: 20px;
  /* Allow the overlay itself to scroll on very small screens */
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  /* Ensure the card itself can receive scroll events */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-card::-webkit-scrollbar {
  width: 5px;
}
.modal-card::-webkit-scrollbar-track {
  background: transparent;
}
.modal-card::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.modal-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  padding: 3px 10px;
  border-radius: 100px;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 16px;
}

.solution-btn {
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.solution-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}

.modal-close:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.modal-body {
  padding: 24px 28px 28px;
}

.problem-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.problem-section {
  margin-bottom: 22px;
}

.problem-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.problem-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.io-section {
  margin-bottom: 0;
}

/* Example input/output blocks */
.example-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.7;
}

/* ---- Code area ---- */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.code-tabs {
  display: flex;
  gap: 6px;
}

.tab {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  transition: all var(--transition);
}

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

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.code-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

pre[class*="language-"] {
  margin: 0 !important;
  border-radius: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  max-height: 380px;
  overflow-y: auto;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
    letter-spacing: -0.5px;
  }

  .hero p { font-size: 15px; }

  .hero-stats {
    padding: 14px 20px;
    gap: 20px;
  }

  .nav-center { display: none; }

  .filter-bar { padding: 10px 4%; }

  .filters { gap: 8px; }

  .filter-group { padding: 7px 11px; }

  .questions-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-card {
    min-width: 300px;
    max-width: 300px;
  }

  .feedback-card {
    padding: 28px 20px;
  }

  .modal-header {
    padding: 18px 18px 14px;
  }

  .modal-body {
    padding: 18px;
  }

  .io-grid {
    grid-template-columns: 1fr;
  }

  .modal-header h2 {
    font-size: 15px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .questions-section { padding: 10px 4% 50px; }
  .hero { padding-left: 4%; padding-right: 4%; }
}


/* email popup */
.email-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--green);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 9999;
}
.email-popup.show {
  opacity: 1;
  pointer-events: auto;
}