/* ==========================================================================
   nessvyuh - Layout Stylesheet
   Header, Hero, Sticky Filter Bar, Continuous Stream, Drawers
   ========================================================================== */

/* App Container */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.brand-title:hover {
  color: var(--accent-terracotta);
}

/* Exam Branch & Year Switcher Group beside GATE DA */
.exam-nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exam-branch-dropdown {
  position: relative;
  display: inline-block;
}

.branch-select-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.branch-select-btn:hover {
  border-color: var(--accent-terracotta);
  background: var(--surface-card);
}

/* 2025 / 2026 Filter Pills Placed Directly Beside GATE DA */
.header-year-pill-group {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.header-year-pill {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.header-year-pill:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}

.header-year-pill.active {
  background: var(--surface-card);
  color: var(--accent-terracotta);
  box-shadow: var(--shadow-sm);
}

.branch-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.4rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 220px;
  padding: 0.4rem;
  display: none;
  z-index: 120;
}

.branch-menu.show {
  display: block;
}

.branch-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.branch-menu-item:hover {
  background: var(--bg-secondary);
}

.branch-menu-item.active {
  background: var(--accent-terracotta-soft);
  color: var(--accent-terracotta);
  font-weight: 600;
}

.branch-badge-future {
  font-size: 0.65rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

/* Header Middle: Mode Switcher */
.mode-toggle-group {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 3px;
  position: relative;
}

.mode-btn {
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

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

.mode-btn.active {
  background: var(--surface-card);
  color: var(--accent-terracotta);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Header Right: Tool Shortcuts */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-action-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--surface-card);
}

.header-action-btn.active {
  color: var(--accent-terracotta);
  border-color: var(--accent-terracotta-border);
  background: var(--accent-terracotta-soft);
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Tooltip for Action Buttons without text (Buy us a Coffee & Recommend us things) */
.action-tooltip-btn {
  position: relative;
}

.action-tooltip-btn::after {
  content: attr(data-action-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 0.38rem 0.72rem;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-md);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 150;
}

.action-tooltip-btn:hover::after,
.action-tooltip-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Feedback Chip */
.feedback-chip {
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feedback-chip:hover,
.feedback-chip.active {
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
  background: var(--accent-terracotta-soft);
}

/* Timer Badge in Quiz Mode */
.quiz-timer-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s infinite ease-in-out;
}

.quiz-timer-badge.warning .timer-dot {
  background: var(--color-danger);
}

.quiz-timer-badge.paused {
  opacity: 0.8;
  border-style: dashed;
  background: var(--surface-muted);
}

.quiz-timer-badge.paused .timer-dot {
  background: var(--text-muted);
  animation: none;
}

/* Submit & Restart Header Buttons */
.header-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--accent-terracotta);
  border: 1px solid var(--accent-terracotta);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-submit-btn:hover {
  background: var(--accent-terracotta-hover);
  border-color: var(--accent-terracotta-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(204, 120, 92, 0.35);
}

.header-restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-restart-btn:hover {
  color: var(--color-danger);
  border-color: rgba(220, 53, 69, 0.4);
  background: var(--surface-card);
}

/* Bottom Continuous Feed Submission & Restart Banner */
.feed-bottom-banner {
  margin-top: 2rem;
  margin-bottom: 3.5rem;
  padding: 1.8rem 2rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.feed-bottom-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.feed-bottom-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.feed-bottom-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feed-bottom-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent-terracotta);
  border: 1px solid var(--accent-terracotta);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feed-bottom-actions .btn-primary:hover {
  background: var(--accent-terracotta-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.feed-bottom-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feed-bottom-actions .btn-secondary:hover {
  color: var(--text-primary);
  background: var(--surface-card-hover);
}

/* Hero Section */
.hero-section {
  padding: 2.2rem 1.5rem 1.8rem;
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-badge.highlight {
  background: var(--accent-terracotta-soft);
  color: var(--accent-terracotta);
  border-color: var(--accent-terracotta-border);
  font-weight: 600;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.hero-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 740px;
  line-height: 1.6;
}

/* Minimalist Stats & Quick Metrics */
.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--border-medium);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-visual-flourish {
  position: absolute;
  top: 1.5rem;
  right: 0.5rem;
  opacity: 0.75;
  pointer-events: none;
}

/* Sticky Continuous Scroll Toolbar */
.sticky-filter-toolbar {
  position: sticky;
  top: 54px;
  z-index: 90;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: all var(--transition-fast);
}

.toolbar-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toolbar-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Year Tabs */
.year-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  padding: 3px;
  border-radius: var(--radius-md);
}

.year-tab-btn {
  display: inline-block;
  padding: 0.32rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.year-tab-btn.active {
  background: var(--surface-card);
  color: var(--accent-terracotta);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Search Box */
.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 180px;
}

.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.35rem 0.7rem 0.35rem 2.1rem;
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-terracotta);
}

/* Secondary Filter Row (Subject Chips) */
.subject-chips-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.subject-chips-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  white-space: nowrap;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-chip:hover {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.filter-chip.active {
  background: var(--accent-terracotta);
  color: #FFFFFF;
  border-color: var(--accent-terracotta);
  font-weight: 600;
}

/* Tertiary Filter Row: Type & Marks & Minimap Trigger */
.toolbar-tertiary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 0.2rem;
  flex-wrap: wrap;
}

.type-filter-group, .marks-filter-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.type-btn, .marks-btn {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.74rem;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.type-btn:hover, .marks-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.type-btn.active, .marks-btn.active {
  background: var(--surface-card);
  border-color: var(--border-medium);
  color: var(--accent-terracotta);
  font-weight: 600;
}

/* Question Palette Minimap Toggle */
.minimap-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.minimap-toggle-btn:hover {
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
}

/* Main Continuous Feed Container */
.feed-container {
  max-width: var(--max-content-width);
  margin: 1.5rem auto 4rem;
  padding: 0 1.5rem;
  width: 100%;
}

.questions-stream {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--surface-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
}

.empty-state-svg {
  width: 48px;
  height: 48px;
  color: var(--accent-terracotta);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Floating Quick-Jump Drawer (Question Palette) */
.quick-jump-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;
  width: 310px;
  max-height: 80vh;
  background: var(--surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  z-index: 110;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
}

.quick-jump-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.quick-jump-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-jump-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.palette-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.1rem;
  background: var(--bg-secondary);
  font-size: 0.7rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.answered { background: var(--color-success); }
.legend-dot.review { background: var(--accent-terracotta); }
.legend-dot.unanswered { background: var(--border-medium); }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem;
  padding: 0.9rem;
  overflow-y: auto;
  max-height: 380px;
}

.palette-num-btn {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.palette-num-btn:hover {
  border-color: var(--accent-terracotta);
  color: var(--text-primary);
  transform: scale(1.05);
}

.palette-num-btn.answered {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
  font-weight: 600;
}

.palette-num-btn.review {
  background: var(--accent-terracotta-soft);
  border-color: var(--accent-terracotta-border);
  color: var(--accent-terracotta);
  font-weight: 600;
}

.palette-num-btn.starred {
  box-shadow: inset 0 0 0 1px var(--color-warning);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

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

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .toolbar-primary-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrap {
    max-width: 100%;
  }
  .hero-visual-flourish {
    display: none;
  }
  .quick-jump-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

