/* ==========================================================================
   WORD BUCKETS GRAMMAR PAGE STYLESHEET
   Clean 2-Column Workspace, Topic Display, Code & Tables, Practice Quiz
   Theme: Vibrant Orange & Light Slate Gray / Silver
   ========================================================================== */

.grammar-main-wrapper {
  --accent-primary: #ff6b00;
  --accent-primary-hover: #ea580c;
  --accent-gradient: linear-gradient(135deg, #ff6b00 0%, #f97316 45%, #efefef 100%);
  --border-active: rgba(255, 107, 0, 0.45);
  padding-top: var(--header-height);
  min-height: 100vh;
}

.grammar-hero-banner {
  padding: 3rem 0 2rem 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.sub-heading-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ff6b00;
  background: rgba(255, 107, 0, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 107, 0, 0.28);
}

.grammar-hero-title {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.grammar-hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* 2-Column Layout */
.grammar-workspace {
  padding: 1.5rem 1.5rem 5rem 1.5rem;
}

.grammar-layout-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 2rem;
  align-items: start;
  transition: grid-template-columns 0.3s ease;
}

.grammar-layout-grid.sidebar-collapsed {
  grid-template-columns: 1fr;
}

/* Sidebar */
.grammar-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  transition: all 0.3s ease;
}

.grammar-sidebar.collapsed {
  display: none;
}

/* Floating Expand Trigger when Sidebar is Collapsed */
.sidebar-expand-trigger {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1.5px solid #ff6b00;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(239, 239, 239, 0.15));
  color: #ff6b00;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.18);
  margin-bottom: 1.25rem;
  transition: all var(--transition-normal);
}

.sidebar-expand-trigger:hover {
  background: linear-gradient(135deg, #ff6b00 0%, #f97316 45%, #efefef 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.35);
}

.sidebar-collapsed .sidebar-expand-trigger {
  display: inline-flex;
}

.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  max-height: calc(100vh - var(--header-height) - 3rem);
  overflow-y: auto;
  position: relative;
}

.sidebar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff6b00, #f97316, #efefef, #ffffff);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Custom scrollbar for sidebar */
.sidebar-card::-webkit-scrollbar {
  width: 5px;
}
.sidebar-card::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-card::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 107, 0, 0.5), rgba(239, 239, 239, 0.4));
  border-radius: 4px;
}
.sidebar-card::-webkit-scrollbar-thumb:hover {
  background: #ff6b00;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.sidebar-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-header-left svg {
  color: #ff6b00;
}

.sidebar-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.sidebar-toggle-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.sidebar-toggle-btn:hover {
  color: #ff6b00;
  border-color: rgba(255, 107, 0, 0.5);
  background: rgba(255, 107, 0, 0.1);
}

/* Tree Navigation */
.chapter-index-nav.tree-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tree-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.tree-group:hover {
  border-color: rgba(255, 107, 0, 0.35);
}

.tree-group.has-active {
  border-color: rgba(255, 107, 0, 0.55);
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.1);
}

.tree-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: left;
  gap: 0.65rem;
  transition: background var(--transition-normal);
}

.tree-group-header:hover {
  background: linear-gradient(90deg, rgba(255, 107, 0, 0.08) 0%, rgba(239, 239, 239, 0.08) 100%);
}

.tree-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.tree-group-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b00 0%, #f97316 45%, #efefef 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.25);
}

.tree-group-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.tree-chevron {
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.tree-group.open .tree-chevron {
  transform: rotate(180deg);
  color: #ff6b00;
}

.tree-group-items {
  display: none;
  padding: 0.35rem 0.45rem 0.55rem 0.45rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  flex-direction: column;
  gap: 0.35rem;
}

.tree-group.open .tree-group-items {
  display: flex !important;
}

.tree-empty-notice {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tree-empty-notice .empty-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(239, 239, 239, 0.2));
  color: #ff6b00;
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.index-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: var(--text-main);
}

.index-item:hover {
  background: linear-gradient(90deg, rgba(255, 107, 0, 0.07) 0%, rgba(239, 239, 239, 0.06) 100%);
  border-color: rgba(255, 107, 0, 0.25);
}

.index-item.active {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.14) 0%, rgba(239, 239, 239, 0.06) 100%);
  border-color: rgba(255, 107, 0, 0.5);
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.15);
}

.ch-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(239, 239, 239, 0.08);
  border: 1px solid rgba(239, 239, 239, 0.2);
  min-width: 34px;
  width: auto;
  padding: 0 0.35rem;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.index-item:hover .ch-number {
  border-color: #ff6b00;
  background: rgba(255, 107, 0, 0.15);
  color: #ff6b00;
}

.index-item.active .ch-number {
  background: linear-gradient(135deg, #ff6b00 0%, #f97316 45%, #efefef 100%);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 107, 0, 0.4);
  box-shadow: 0 2px 10px rgba(255, 107, 0, 0.35);
}

.ch-meta {
  display: flex;
  flex-direction: column;
}

.ch-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  transition: all var(--transition-normal);
}

/* Gradient Title for Active Topic */
.index-item.active .ch-title {
  background: linear-gradient(135deg, #ff7a18 0%, #fb923c 45%, #efefef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

[data-theme="light"] .index-item.active .ch-title {
  background: linear-gradient(135deg, #ea580c 0%, #d97706 45%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.ch-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.index-item.active .ch-subtitle {
  color: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .index-item.active .ch-subtitle {
  color: #475569;
}

/* Right Content Display Area */
.grammar-content-display {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem 2.5rem 2.25rem;
  box-shadow: var(--card-shadow);
  min-height: 500px;
}

/* Content Tab Bar (Ders İçeriği / Pratik Yap) */
.content-tab-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 2rem;
  padding-bottom: 0;
}

.content-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.56rem;
  padding: 0.75rem 1.35rem;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: all var(--transition-normal);
}

.content-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}

.content-tab-btn.active {
  color: var(--accent-primary);
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  border-bottom: 2px solid var(--accent-primary);
  font-weight: 700;
}

.tab-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

/* Views */
.content-view {
  animation: fadeIn 0.25s ease;
}

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

/* Topic Styling */
.grammar-topic .topic-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.topic-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: var(--accent-gradient);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.grammar-topic h2 {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}

.grammar-topic h3 {
  font-size: 1.35rem;
  color: var(--accent-primary);
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.grammar-topic h4 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.grammar-topic h5 {
  font-size: 0.98rem;
  color: var(--text-main);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.grammar-topic p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.info-note {
  background: rgba(255, 107, 0, 0.08);
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem !important;
  color: var(--text-main) !important;
}

.scenario-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(255, 107, 0, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
}

.scenario-box p {
  margin-bottom: 0.75rem;
}

.scenario-box p:last-child {
  margin-bottom: 0;
}

/* Rule Boxes */
.rule-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.rule-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
}

.rule-tag {
  font-weight: 700;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.example-text {
  margin-bottom: 0 !important;
  font-size: 0.95rem !important;
}

.danger-item {
  border-left-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.danger-tag {
  color: #ef4444 !important;
}

.danger-text {
  color: #ef4444 !important;
}

/* Grammar Table */
.table-container {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.grammar-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.grammar-table th {
  background: var(--bg-elevated);
  padding: 0.85rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.grammar-table td {
  padding: 0.85rem 1.1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

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

.grammar-table td span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.grammar-table code {
  background: var(--bg-main);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--accent-primary);
  font-family: 'Fira Code', monospace;
}

/* Example Lists */
.example-list, .pattern-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0;
}

.example-list li, .pattern-list li {
  background: var(--bg-elevated);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  color: var(--text-main);
}

.example-list li span, .pattern-list li span {
  color: var(--text-muted);
  font-style: italic;
  margin-left: 0.35rem;
}

.numbered-list {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0;
}

.numbered-list li {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
}

.numbered-list li span {
  color: var(--text-muted);
  font-style: italic;
  margin-left: 0.35rem;
}

.sub-section {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

/* Pattern Grids */
.pattern-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.pattern-grid code {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: var(--accent-primary);
}

/* PRACTICE QUIZ AREA */
.practice-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.practice-header h2 {
  font-size: 1.8rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.practice-desc {
  font-size: 1rem;
  color: var(--text-muted);
}

.quiz-card-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease;
}

.quiz-card-item.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
}

.quiz-card-item.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.quiz-q-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.quiz-question-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.blank-spot {
  display: inline-block;
  min-width: 70px;
  padding: 0.15rem 0.5rem;
  border-bottom: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 800;
  text-align: center;
}

.quiz-translation {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.25rem;
}

.quiz-options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.option-btn {
  padding: 0.5rem 1.1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.option-btn.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: #ffffff;
}

.quiz-feedback-msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.msg-correct { color: #10b981; }
.msg-incorrect { color: #ef4444; }

/* Quiz Footer / Score Banner */
.quiz-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
}

.quiz-score-badge {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-score-badge span {
  color: var(--accent-primary);
  font-size: 1.2rem;
}

.reset-quiz-btn {
  padding: 0.6rem 1.25rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.reset-quiz-btn:hover {
  opacity: 0.9;
}

.active-nav {
  color: var(--accent-primary) !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   GRAMMAR WORKSPACE TOP BAR (BACK BUTTON & TITLE)
   ========================================================================== */

.grammar-workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.25rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
}

.grammar-back-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  cursor: pointer;
}

.grammar-back-circle-btn:hover {
  background: var(--accent-gradient);
  border-color: #ff6b00;
  color: #ffffff;
  transform: translateX(-3px) scale(1.05);
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.3);
}

.grammar-workspace-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0;
}

.workspace-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.level-badge-elem {
  background: rgba(255, 107, 0, 0.14);
  color: #ff6b00;
  border: 1px solid rgba(255, 107, 0, 0.35);
  box-shadow: 0 2px 10px rgba(255, 107, 0, 0.15);
}

.level-badge-inter {
  background: rgba(37, 99, 235, 0.14);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.15);
}

.level-badge-adv {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   GRAMMAR HUB & 3 LEVEL CARDS STYLES
   ========================================================================== */

.grammar-hub-wrapper {
  padding-bottom: 5rem;
}

.grammar-hub-header-section {
  padding: 2.5rem 1.5rem 1.25rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.grammar-hub-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.grammar-header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(249, 115, 22, 0.15));
  border: 1px solid rgba(255, 107, 0, 0.3);
  color: #ff6b00;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.15);
}

.grammar-hub-title {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin: 0;
}

.grammar-levels-section {
  padding-top: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.grammar-level-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: stretch;
}

.grammar-level-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.grammar-level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 24px 24px 0 0;
}

.grammar-level-card.card-elementary::before {
  background: linear-gradient(90deg, #ff6b00, #f97316);
}

.grammar-level-card.card-intermediate::before {
  background: linear-gradient(90deg, #2563eb, #0284c7);
}

.grammar-level-card.card-advanced::before {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

.grammar-level-card:hover:not(.is-disabled) {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.grammar-level-card.card-elementary:hover {
  border-color: rgba(255, 107, 0, 0.45);
  box-shadow: 0 20px 40px rgba(255, 107, 0, 0.12);
}

.grammar-level-card.card-intermediate:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.12);
}

.level-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.level-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.level-number-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  color: #ffffff;
}

.card-elementary .level-number-badge {
  background: linear-gradient(135deg, #ff6b00, #f97316);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.35);
}

.card-intermediate .level-number-badge {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.card-advanced .level-number-badge {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.level-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.tag-elementary {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tag-intermediate {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.tag-advanced {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.level-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.box-elementary {
  background: rgba(255, 107, 0, 0.1);
  color: #ff6b00;
}

.box-intermediate {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.box-advanced {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.level-card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.level-card-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.level-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.level-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.level-card-features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-elementary .level-card-features li svg {
  color: #ff6b00;
  flex-shrink: 0;
}

.card-intermediate .level-card-features li svg {
  color: #2563eb;
  flex-shrink: 0;
}

.card-advanced .level-card-features li svg {
  color: #8b5cf6;
  flex-shrink: 0;
}

.level-card-footer {
  margin-top: auto;
}

.level-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-elementary {
  background: linear-gradient(135deg, #ff6b00 0%, #f97316 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.32);
}

.btn-elementary:hover {
  background: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 0, 0.42);
}

.btn-intermediate {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
}

.btn-intermediate:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #0369a1 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.42);
}

.btn-advanced.disabled {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  cursor: not-allowed;
  box-shadow: none;
}

.badge-coming-soon {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-left: 0.35rem;
}

.is-disabled {
  opacity: 0.75;
}

@media (max-width: 1024px) {
  .grammar-level-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .grammar-layout-grid {
    grid-template-columns: 1fr;
  }
  .grammar-sidebar {
    position: relative;
    top: 0;
  }
}

@media (max-width: 680px) {
  .grammar-level-cards-grid {
    grid-template-columns: 1fr;
  }
  .grammar-hub-title {
    font-size: 2rem;
  }
}
