/* ==========================================================================
   English Grammar Portal - Modern Masterclass Stylesheet
   Crafted with modern CSS variables, glassmorphism, responsive grid & dark mode
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* --- Root Color Tokens & Theme Variables --- */
:root {
  /* Font Stacks */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Brand Palette (Indigo / Violet Gradient) */
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --primary-rgb: 79, 70, 229;
  
  --secondary: #8b5cf6;
  --secondary-light: #a78bfa;

  /* Semantic State Colors */
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.1);
  --emerald-border: rgba(16, 185, 129, 0.3);

  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.1);
  --rose-border: rgba(244, 63, 94, 0.3);

  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --amber-border: rgba(245, 158, 11, 0.3);

  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.1);
  --cyan-border: rgba(6, 182, 212, 0.3);

  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.1);
  --purple-border: rgba(139, 92, 246, 0.3);

  /* Default Light Theme */
  --bg-page: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --bg-code: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: #6366f1;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --sidebar-width: 320px;
  --header-height: 68px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-page: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-card: #141e33;
  --bg-card-subtle: #1e293b;
  --bg-card-hover: #1b263f;
  --bg-code: #090d16;
  --bg-glass: rgba(15, 23, 42, 0.88);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0f172a;

  --border-light: #1e293b;
  --border-focus: #818cf8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(129, 140, 248, 0.2);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-subtle);
  border-radius: var(--radius-full);
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection */
::selection {
  background: rgba(99, 102, 241, 0.25);
  color: var(--primary-light);
}

/* App Wrapper Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SIDEBAR (Sol Menü)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), background-color var(--transition-normal);
}

.sidebar-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
}

/* Theme Switch Button */
.theme-toggle-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(15deg);
}

/* Search Bar in Sidebar */
.sidebar-search-box {
  padding: 14px 20px 10px;
}

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

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
  font-size: 0.9rem;
}

.search-input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.85rem;
  display: none;
  padding: 4px;
}
.search-clear-btn:hover {
  color: var(--rose);
}

.search-shortcut-badge {
  position: absolute;
  right: 10px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

/* Accordion Category Group */
.accordion-group {
  margin-bottom: 12px;
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-fast);
}

.accordion-header:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.accordion-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-weight: 600;
}

.accordion-badge.upcoming {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-subtle);
}

.accordion-chevron {
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.accordion-group.open .accordion-chevron {
  transform: rotate(90deg);
}

/* Submenu List */
.accordion-content {
  display: none;
  list-style: none;
  padding: 4px 0 6px 4px;
}

.accordion-group.open .accordion-content {
  display: block;
}

.nav-item {
  margin-bottom: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(139, 92, 246, 0.1));
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

[data-theme="dark"] .nav-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
  color: #a5b4fc;
}

.nav-link-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-link-en {
  font-size: 0.88rem;
  line-height: 1.3;
}

.nav-link-tr {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 400;
}

.nav-link.active .nav-link-tr {
  color: var(--primary-light);
}

.nav-level-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.nav-link.disabled:hover {
  transform: none;
  background: transparent;
  color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* ==========================================================================
   MOBILE TOPBAR & DRAWER OVERLAY
   ========================================================================== */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
}

.hamburger-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 95;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   MAIN CONTENT AREA (Sağ İçerik Alanı)
   ========================================================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 32px 48px 80px;
  max-width: 1320px;
  transition: margin-left var(--transition-normal);
}

/* Quick Jump Header Navigation / Breadcrumb */
.top-navigation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb-trail a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumb-trail a:hover {
  color: var(--primary);
}
.breadcrumb-separator {
  color: var(--text-subtle);
  font-size: 0.75rem;
}
.breadcrumb-current {
  color: var(--primary);
  font-weight: 600;
}

/* Quick Section Jumper Badges */
.quick-jumper-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-jump-btn {
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.quick-jump-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Hero Banner Card --- */
.hero-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%), var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
}

.tense-category-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.hero-title-group {
  margin-bottom: 14px;
}

.hero-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-turkish-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 4px;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Audio Pronunciation / TTS Button */
.tts-speech-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.tts-speech-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.tts-speech-btn.playing {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==========================================================================
   CONTENT SECTIONS & CARD UI
   ========================================================================== */
.content-section {
  margin-bottom: 36px;
  scroll-margin-top: 24px;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-number-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Common Card Base */
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.portal-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}

/* --- 1. Overview Section --- */
.overview-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overview-summary-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
}

.timeline-visual-bar {
  background: var(--bg-card-subtle);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.timeline-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.timeline-text {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
}

.highlight-bullet-icon {
  color: var(--emerald);
  font-size: 1rem;
  margin-top: 2px;
}

.highlight-item-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
}

/* --- 2. Formulas Section (Tablo Formatı) --- */
.formulas-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.formula-card-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.formula-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.formula-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 10px;
}

.formula-type-tag {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-type-tag.positive { color: var(--emerald); }
.formula-type-tag.negative { color: var(--rose); }
.formula-type-tag.question { color: var(--primary); }
.formula-type-tag.wh { color: var(--purple); }

.formula-rule-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* Modern Formulas Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.formula-table th {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

.formula-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.formula-table tr:last-child td {
  border-bottom: none;
}

.table-token-subj {
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
}

.table-token-aux {
  font-weight: 600;
  color: var(--purple);
  font-family: var(--font-mono);
  background: var(--purple-bg);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.table-token-verb {
  font-weight: 700;
  color: var(--emerald);
  font-family: var(--font-mono);
  background: var(--emerald-bg);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.table-token-obj {
  color: var(--text-main);
}

.table-row-tr {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Short Answers Section */
.short-answers-container {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.short-answers-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.short-answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.short-answer-item {
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.short-ans-q {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.short-ans-responses {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.short-ans-pos {
  color: var(--emerald);
  font-weight: 600;
}
.short-ans-neg {
  color: var(--rose);
  font-weight: 600;
}

/* --- 3. Usage Rules Section --- */
.usage-rules-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.usage-rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.usage-rule-head {
  margin-bottom: 10px;
}

.usage-rule-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.usage-rule-explanation {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.usage-examples-wrapper {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.example-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition-fast);
}

.example-box:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--bg-card-hover);
}

.example-text-group {
  flex: 1;
}

.example-en {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
}

.example-tr {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.example-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.action-icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.action-icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

/* --- 4. Time Expressions / Signal Words --- */
.time-expressions-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.time-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.signal-word-chip {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.signal-percentage-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.signal-meaning {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.signal-example {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-style: italic;
  border-left: 2px solid var(--primary-light);
}

/* Callout Box (Positioning / Pro Rule) */
.portal-callout {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.portal-callout.info {
  background: var(--cyan-bg);
  border: 1px solid var(--cyan-border);
  color: var(--text-main);
}

.portal-callout.tip {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--text-main);
}

.callout-icon {
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-content {
  font-size: 0.88rem;
  line-height: 1.5;
}

.callout-content strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-main);
}

/* --- 5. Common Mistakes & Pro Tips --- */
.mistakes-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.mistake-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

.mistake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.mistake-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.mistake-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.mistake-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.mistake-bullets {
  list-style: none;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mistake-bullets li {
  font-size: 0.88rem;
  color: var(--text-main);
  padding-left: 18px;
  position: relative;
}

.mistake-bullets li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--primary);
  font-weight: bold;
}

/* Wrong vs Right Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.comparison-box {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comparison-box.wrong {
  background: var(--rose-bg);
  border: 1px solid var(--rose-border);
}

.comparison-box.correct {
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
}

.comp-badge {
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
}

.comparison-box.wrong .comp-badge {
  color: var(--rose);
}
.comparison-box.correct .comp-badge {
  color: var(--emerald);
}

.comp-sentence {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.comparison-box.wrong .comp-sentence {
  color: var(--rose);
  text-decoration: line-through;
}

.comparison-box.correct .comp-sentence {
  color: var(--emerald);
}

.mistake-why-box {
  background: var(--bg-card-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.mistake-why-box strong {
  color: var(--primary);
}

/* --- 6. Sentence Breakdown / Visual Parser --- */
.sentence-parser-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 30px 34px;
}

.parser-lead-sentence {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 24px;
  text-align: center;
}

.parser-en-text {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.parser-tr-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Interactive Segment Chips */
.parser-tokens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.token-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--transition-fast);
}
.token-card:hover {
  transform: translateY(-2px);
}

.token-role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-word {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.token-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Token Color Themes */
.token-card.blue { border-color: rgba(59, 130, 246, 0.3); background: rgba(59, 130, 246, 0.05); }
.token-card.blue .token-role { color: #3b82f6; }
.token-card.blue .token-word { color: #2563eb; }

.token-card.purple { border-color: rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.05); }
.token-card.purple .token-role { color: #8b5cf6; }
.token-card.purple .token-word { color: #7c3aed; }

.token-card.emerald { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.05); }
.token-card.emerald .token-role { color: #10b981; }
.token-card.emerald .token-word { color: #059669; }

.token-card.amber { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.05); }
.token-card.amber .token-role { color: #f59e0b; }
.token-card.amber .token-word { color: #d97706; }

.token-card.cyan { border-color: rgba(6, 182, 212, 0.3); background: rgba(6, 182, 212, 0.05); }
.token-card.cyan .token-role { color: #06b6d4; }
.token-card.cyan .token-word { color: #0891b2; }

.token-card.rose { border-color: rgba(244, 63, 94, 0.3); background: rgba(244, 63, 94, 0.05); }
.token-card.rose .token-role { color: #f43f5e; }
.token-card.rose .token-word { color: #e11d48; }

/* Dark adjustments for tokens */
[data-theme="dark"] .token-card.blue .token-word { color: #93c5fd; }
[data-theme="dark"] .token-card.purple .token-word { color: #c4b5fd; }
[data-theme="dark"] .token-card.emerald .token-word { color: #6ee7b7; }
[data-theme="dark"] .token-card.amber .token-word { color: #fcd34d; }
[data-theme="dark"] .token-card.cyan .token-word { color: #67e8f9; }
[data-theme="dark"] .token-card.rose .token-word { color: #fda4af; }

/* --- 7. Mini Self-Check Quiz --- */
.quiz-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
}

.quiz-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.quiz-badge {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--emerald-bg);
  color: var(--emerald);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.quiz-questions-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quiz-question-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.quiz-q-prompt {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 14px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  transform: translateX(4px);
}

.quiz-option-btn.correct {
  background: var(--emerald-bg) !important;
  border-color: var(--emerald) !important;
  color: var(--emerald) !important;
  font-weight: 600;
}

.quiz-option-btn.wrong {
  background: var(--rose-bg) !important;
  border-color: var(--rose) !important;
  color: var(--rose) !important;
  font-weight: 600;
}

.quiz-explanation-box {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border-left: 3px solid var(--primary);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: none;
}
.quiz-explanation-box.show {
  display: block;
}

/* Bottom Progression Navigation */
.topic-pagination-row {
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.pager-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.pager-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Floating Back To Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 80;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   SEARCH RESULTS MODAL / EMPTY STATE
   ========================================================================== */
.search-results-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-results-overlay.open {
  display: flex;
}

.search-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 620px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.search-dialog-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-dialog-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.search-dialog-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.search-dialog-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-hit-item {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.search-hit-item:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.search-hit-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.search-hit-context {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.search-empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

/* Toast Notification (Copy/Speak feedback) */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: var(--bg-page);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 300;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .main-content {
    padding: 28px 24px 60px;
  }
  
  .hero-card {
    padding: 28px 26px;
  }

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

@media (max-width: 860px) {
  .mobile-topbar {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding-top: calc(var(--header-height) + 20px);
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-main-title {
    font-size: 1.7rem;
  }

  .hero-turkish-title {
    font-size: 1.1rem;
  }

  .portal-card, .usage-rule-card, .mistake-card, .sentence-parser-card, .quiz-section-card {
    padding: 20px 18px;
  }

  .formula-box-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .parser-en-text {
    font-size: 1.05rem;
  }
}
