:root {
  --primary: #ff6b35;
  --primary-light: #ff8c42;
  --background: #fff5f0;
  --background-alt: #ffe4d6;
  --text: #2c3e50;
  --text-secondary: #7f8c8d;
  --card-bg: #ffffff;
  --card-text: #2c3e50;
  --input-bg: #ffffff;
  --input-text: #2c3e50;
  --border: rgba(255, 107, 53, 0.2);
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  --shadow-strong: 0 10px 30px rgba(0, 0, 0, 0.15);
  --success: #27ae60;
  --error: #e74c3c;
  --warning: #f39c12;
  --gradient-main: linear-gradient(135deg, #fff5f0 0%, #ffe4d6 100%);
  --gradient-hero: linear-gradient(135deg, #ff6b35 0%, #ff8c42 40%, #ffd580 100%);
  --gradient-btn: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  --gradient-tense: linear-gradient(90deg, #ffb347 0%, #ff6b35 100%);
}

body.dark-mode {
  --primary: #4a90e2;
  --primary-light: #5ba0f2;
  --background: #1a1a2e;
  --background-alt: #16213e;
  --text: #e8e8e8;
  --text-secondary: #b8b8b8;
  --card-bg: #0f3460;
  --card-text: #e8e8e8;
  --input-bg: #16213e;
  --input-text: #e8e8e8;
  --border: rgba(74, 144, 226, 0.3);
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  --shadow-strong: 0 10px 30px rgba(0, 0, 0, 0.5);
  --success: #27ae60;
  --error: #e74c3c;
  --warning: #f39c12;
  --gradient-main: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --gradient-hero: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
  --gradient-btn: linear-gradient(135deg, #4a90e2 0%, #5ba0f2 100%);
  --gradient-tense: linear-gradient(90deg, #4a90e2 0%, #5ba0f2 100%);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gradient-main);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

.hidden {
    display: none !important;
}

/* Navigation */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1400px; /* INCREASED from 1200px */
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  gap: 1rem;
}

.nav-brand {
    flex: 0 0 auto; /* CHANGED */
    margin-right: 1rem; /* CHANGED from auto */
}

.nav-brand h1 {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.3s ease;
  margin: 0;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* REDUCED from 1rem to save space */
  flex-shrink: 0;
  margin-left: auto; /* Keeps it on the right */
}

#user-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

#user-name {
  color: var(--text);
  font-weight: 600;
  margin-right: 1rem;
  white-space: nowrap; /* ADD THIS - prevents text wrapping */
}

#user-xp-level, #user-streak {
  color: var(--text);
  font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
  background: var(--gradient-btn);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.section {
  margin-bottom: 3rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--gradient-hero);
  border-radius: 24px;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-strong);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero h2 {
  font-size: 3rem;
  color: #ffffff;
  margin-bottom: 1rem;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Browse Section */
.browse-section h3 {
  color: var(--text);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

/* Verbify Grid */
.verbify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.verbify-card {
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 15px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.verbify-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
  border-color: var(--primary);
}

.verbify-card h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.verbify-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.verbify-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.verb-count {
  background: var(--primary);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 600;
}

/* Tense Info */
.tense-info {
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: var(--background-alt);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
}

.tense-info small {
  color: var(--text);
}

/* Create Section */
.create-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: var(--shadow-strong);
  color: var(--card-text);
}

.create-container h2 {
  color: var(--text);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--input-text);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Suggestions */
.suggestions {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--card-bg);
  display: none;
}

.suggestion-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background-color 0.3s ease;
}

.suggestion-item:hover {
  background: var(--background-alt);
}

.suggestion-item:last-child {
  border-bottom: none;
}

/* Selected Verbs */
.selected-verbs h4 {
  color: var(--text);
  margin-bottom: 1rem;
}

.verb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.verb-tag {
  background: var(--gradient-btn);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verb-tag .remove-verb {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.verb-tag .remove-verb:hover {
  opacity: 1;
}

/* Tense Selection */
.tense-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--background-alt);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.3s ease;
}

.checkbox-label:hover {
  background: var(--border);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* ===================================
   COMPACT PRACTICE UI - SMALLER SIZES
   =================================== */

/* Practice Container */
.practice-container {
  max-width: 800px; /* Reduced from 900px */
  margin: 0 auto;
}

/* Practice Header - Compact */
.practice-header {
  background: var(--card-bg);
  border-radius: 15px; /* Reduced from 20px */
  padding: 1rem 1.5rem; /* Reduced from 1.5rem 2rem */
  margin-bottom: 1.5rem; /* Reduced from 2rem */
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem; /* Reduced from 1.5rem */
}

.practice-header h2 {
  color: var(--text);
  font-size: 1.5rem; /* Reduced from 2rem */
  margin: 0;
  flex: 1;
}

/* Score Display - Compact */
.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, var(--background-alt) 0%, var(--background) 100%);
  padding: 0.75rem 1rem; /* Reduced from 1rem 1.5rem */
  border-radius: 12px; /* Reduced from 15px */
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  min-width: 120px; /* Reduced from 150px */
}

.score-display span {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem; /* Reduced from 0.9rem */
}

#score-percentage {
  font-size: 1.1rem; /* Reduced from 1.4rem */
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.15rem;
}

/* Practice Mode Toggle - Compact */
.practice-mode-toggle {
  background: var(--card-bg);
  border-radius: 15px; /* Reduced from 20px */
  padding: 1.25rem; /* Reduced from 2rem */
  margin-bottom: 1.5rem; /* Reduced from 2rem */
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.practice-mode-toggle h3 {
  color: var(--text);
  font-size: 1rem; /* Reduced from 1.3rem */
  margin-bottom: 1rem; /* Reduced from 1.5rem */
  font-weight: 600;
}

/* Toggle Container - Compact */
.mode-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem; /* Reduced from 1.5rem */
  margin-bottom: 0.75rem; /* Reduced from 1rem */
}

.mode-label-left,
.mode-label-right {
  font-size: 0.9rem; /* Reduced from 1rem */
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.mode-label-left.active,
.mode-label-right.active {
  color: var(--primary);
  font-size: 0.95rem; /* Reduced from 1.1rem */
}

/* Improved Switch - Smaller */
.switch-label {
  position: relative;
  display: inline-block;
  width: 60px; /* Reduced from 70px */
  height: 32px; /* Reduced from 38px */
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
  transition: all 0.4s ease;
  border-radius: 32px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px; /* Reduced from 30px */
  width: 24px; /* Reduced from 30px */
  left: 4px;
  bottom: 4px;
  background: white;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input:checked + .slider:before {
  transform: translateX(28px); /* Adjusted for new size */
}

/* Mode Description Box - Compact */
.mode-description-box {
  background: var(--background-alt);
  padding: 0.75rem 1rem; /* Reduced from 1rem 1.5rem */
  border-radius: 10px; /* Reduced from 12px */
  margin-top: 1rem; /* Reduced from 1.5rem */
  border-left: 3px solid var(--primary); /* Reduced from 4px */
}

#mode-description {
  color: var(--text);
  font-size: 0.85rem; /* Reduced from 0.95rem */
  margin: 0;
  line-height: 1.5;
}

/* Practice Question Card - Compact */
.practice-question {
  background: var(--card-bg);
  border-radius: 15px; /* Reduced from 20px */
  padding: 1.75rem; /* Reduced from 2.5rem */
  margin-bottom: 1.5rem; /* Reduced from 2rem */
  box-shadow: var(--shadow-strong);
  text-align: center;
  color: var(--card-text);
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}

.practice-question::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px; /* Reduced from 4px */
  background: var(--gradient-btn);
}

/* Question Info Section - Compact */
.question-info {
  margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.verb-display {
  font-size: 2.2rem; /* Reduced from 3rem */
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1rem; /* Reduced from 1.5rem */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: fadeInScale 0.5s ease;
}

.tense-display {
  font-size: 1.1rem; /* Reduced from 1.3rem */
  color: var(--text);
  margin-bottom: 0.5rem; /* Reduced from 0.75rem */
  font-style: italic;
  font-weight: 500;
}

.pronoun-display {
  font-size: 1.4rem; /* Reduced from 1.8rem */
  color: var(--primary);
  font-weight: 600;
  padding: 0.4rem 0.85rem; /* Reduced from 0.5rem 1rem */
  background: var(--background-alt);
  border-radius: 10px; /* Reduced from 12px */
  display: inline-block;
  margin-top: 0.35rem;
}

/* Answer Section - Compact */
.answer-section {
  display: flex;
  gap: 0.85rem; /* Reduced from 1rem */
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.5rem; /* Reduced from 2rem */
}

#answer-input {
  padding: 0.9rem 1.2rem; /* Reduced from 1.2rem 1.5rem */
  font-size: 1.1rem; /* Reduced from 1.3rem */
  border: 2px solid var(--border); /* Reduced from 3px */
  border-radius: 12px; /* Reduced from 15px */
  min-width: 260px; /* Reduced from 300px */
  text-align: center;
  background: var(--input-bg);
  color: var(--input-text);
  font-weight: 500;
  transition: all 0.3s ease;
}

#answer-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15); /* Reduced from 4px */
  transform: translateY(-2px);
}

/* Practice Buttons - Compact */
.practice-question .btn-primary,
.practice-question .btn-secondary {
  padding: 0.75rem 1.5rem; /* Reduced from 1rem 2rem */
  font-size: 0.95rem; /* Reduced from 1.1rem */
  min-width: 110px; /* Reduced from 140px */
}

/* Feedback Section - Compact */
.feedback {
  margin-top: 1.5rem; /* Reduced from 2rem */
  padding: 1.5rem 2rem; /* Reduced from 2rem 2.5rem */
  border-radius: 15px; /* Reduced from 20px */
  text-align: center;
  animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: var(--shadow-strong);
  position: relative;
  z-index: 10;
  border: 2px solid; /* Reduced from 3px */
}

.feedback.correct #feedback-message::before {
  content: '✓ ';
  color: var(--success);
}

.feedback.incorrect #feedback-message::before {
  content: '✗ ';
  color: var(--error);
}

.feedback.correct {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: var(--success);
  color: #155724;
}

body.dark-mode .feedback.correct {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.25) 0%, rgba(39, 174, 96, 0.15) 100%);
  border-color: var(--success);
  color: #27ae60;
}

.feedback.incorrect {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-color: var(--error);
  color: #721c24;
}

body.dark-mode .feedback.incorrect {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.25) 0%, rgba(231, 76, 60, 0.15) 100%);
  border-color: var(--error);
  color: #e74c3c;
}

#feedback-message {
  font-size: 1.4rem; /* Reduced from 1.8rem */
  font-weight: 700;
  margin-bottom: 1rem; /* Reduced from 1.5rem */
}

#correct-answer {
  font-size: 1.1rem; /* Reduced from 1.3rem */
  margin-bottom: 1.25rem; /* Reduced from 1.5rem */
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text);
  padding: 0.75rem 1.5rem; /* Reduced from 1rem 2rem */
  border-radius: 12px; /* Reduced from 15px */
  display: inline-block;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Practice Complete Card - Compact */
.practice-complete {
  text-align: center;
  background: var(--card-bg);
  padding: 2rem 1.5rem; /* Reduced from 3rem 2rem */
  border-radius: 15px; /* Reduced from 20px */
  box-shadow: var(--shadow-strong);
  color: var(--card-text);
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}

.practice-complete::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px; /* Reduced from 6px */
  background: var(--gradient-btn);
}

.practice-complete h3 {
  color: var(--text);
  font-size: 1.8rem; /* Reduced from 2.5rem */
  margin-bottom: 1.5rem; /* Reduced from 2rem */
  font-weight: 700;
}

.final-score {
  background: var(--background-alt);
  padding: 1.5rem; /* Reduced from 2rem */
  border-radius: 12px; /* Reduced from 15px */
  margin-bottom: 1.5rem; /* Reduced from 2rem */
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.final-score div {
  font-size: 1.15rem; /* Reduced from 1.4rem */
  margin-bottom: 0.5rem; /* Reduced from 0.75rem */
  color: var(--text);
  font-weight: 500;
}

.final-score span {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.3rem; /* Reduced from 1.6rem */
}

.practice-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive Adjustments - Compact */
@media (max-width: 768px) {
  .practice-header {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }

  .practice-header h2 {
    font-size: 1.3rem; /* Reduced from 1.5rem */
  }

  .score-display {
    width: 100%;
  }

  .practice-mode-toggle {
    padding: 1rem;
  }

  .practice-mode-toggle h3 {
    font-size: 0.95rem;
  }

  .mode-toggle-container {
    gap: 0.75rem;
  }

  .mode-label-left,
  .mode-label-right {
    font-size: 0.85rem;
  }

  .verb-display {
    font-size: 1.8rem; /* Reduced from 2.2rem */
  }

  .tense-display {
    font-size: 1rem;
  }

  .pronoun-display {
    font-size: 1.2rem; /* Reduced from 1.4rem */
    padding: 0.35rem 0.75rem;
  }

  #answer-input {
    min-width: 100%;
    font-size: 1rem; /* Reduced from 1.1rem */
    padding: 0.8rem 1rem;
  }

  .answer-section {
    flex-direction: column;
    gap: 0.75rem;
  }

  .practice-question {
    padding: 1.25rem; /* Reduced from 1.5rem */
  }

  .practice-question .btn-primary,
  .practice-question .btn-secondary {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .practice-complete {
    padding: 1.5rem 1rem; /* Reduced from 2rem 1rem */
  }

  .practice-complete h3 {
    font-size: 1.5rem; /* Reduced from 1.8rem */
  }

  #feedback-message {
    font-size: 1.2rem;
  }

  #correct-answer {
    font-size: 1rem;
    padding: 0.6rem 1.25rem;
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: var(--shadow-strong);
  color: var(--card-text);
}

.modal-content.edit-modal {
  max-width: 700px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--primary);
}

.auth-form h3 {
  color: var(--text);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.auth-form p {
  text-align: center;
  margin-top: 1rem;
  color: var(--text);
}

.auth-form a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-form a:hover {
  text-decoration: underline;
}

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

body.dark-mode .loading {
  background: rgba(0, 0, 0, 0.9);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 107, 53, 0.3);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

body.dark-mode .spinner {
  border: 4px solid rgba(74, 144, 226, 0.3);
  border-top: 4px solid var(--primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1002;
}

.toast {
  background: var(--primary);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: var(--error);
}

.toast.success {
  background: var(--success);
}

.toast.warning {
  background: var(--warning);
  color: #333333;
}

/* Leaderboard */
.leaderboard-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow-strong);
  padding: 2rem;
  color: var(--card-text);
}

.leaderboard-container h2 {
  color: var(--text);
  text-align: center;
  margin-bottom: 2rem;
}

.leaderboard-list {
  margin-top: 2rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  color: var(--text);
}

.leaderboard-row.top {
  background: var(--gradient-btn);
  color: #ffffff;
  font-weight: bold;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.leaderboard-row .rank {
  width: 2.5em;
  text-align: center;
  font-weight: bold;
}

.leaderboard-row .name {
  flex: 1;
  margin-left: 1em;
}

.leaderboard-row .level,
.leaderboard-row .xp {
  width: 5em;
  text-align: right;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: var(--card-bg);
  min-width: 160px;
  box-shadow: var(--shadow);
  z-index: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: var(--text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
  background: var(--background-alt);
}

/* Footer */
.footer {
  background: var(--primary);
  color: #ffffff;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 1rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.footer a {
  color: #ffffff;
  text-decoration: underline;
  margin: 0 0.5em;
}

.footer a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* XP Progress Bar */
#xp-progress-bar {
  background: var(--background-alt);
  border: 1px solid var(--border);
}

#xp-progress-fill {
  background: var(--gradient-btn);
  transition: width 0.3s ease;
}

/* Like and Share Buttons */
.like-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.like-heart {
  font-size: 1.2rem;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

#next-question {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
  }
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .practice-header {
    flex-direction: column;
    text-align: center;
  }
  
  .verb-display {
    font-size: 2rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .answer-section {
    flex-direction: column;
  }
  
  #answer-input {
    min-width: 100%;
  }
  
  .tense-checkboxes {
    grid-template-columns: 1fr;
  }
  
  .modal-content.edit-modal {
    max-width: 98vw;
    padding: 1rem;
  }
}

/* Dark Mode Toggle Button */
#dark-mode-toggle {
  background: transparent;
  border: 2px solid var(--text);
  color: var(--text);
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

#dark-mode-toggle:hover {
  background: var(--text);
  color: var(--card-bg);
}

/* Community Search Input */
#community-search,
#community-search-page {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

#community-search:focus,
#community-search-page:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

body.dark-mode #community-search:focus,
body.dark-mode #community-search-page:focus {
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Mistakes Modal */
#mistakes-summary {
  color: var(--text);
}

#mode-description {
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

#mistakes-summary h4 {
  color: var(--primary);
  margin: 1rem 0 0.5rem 0;
}

#mistakes-summary ul {
  list-style: none;
  padding: 0;
}

#mistakes-summary li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

#mistakes-summary li:last-child {
  border-bottom: none;
}

#practice-mistakes-btn {
  margin-top: 1rem;
  width: 100%;
}

/* Ensure all text is readable */
h1, h2, h3, h4, h5, h6, p, span, div, label, a, li, td, th {
  color: var(--text);
}

/* Special case for elements that should always be white */
.btn-primary,
.verb-count,
.leaderboard-row.top,
.verb-tag {
  color: #ffffff !important;
}

/* Fix for hero section text */
.hero h2,
.hero p {
  color: #ffffff !important;
}

/* Theme Toggle Switch */
.theme-toggle-wrapper {
  display: inline-block;
  margin: 0 1rem;
  vertical-align: middle;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.toggle-slot {
  position: relative;
  height: 2em;
  width: 4em;
  border: 2px solid var(--border);
  border-radius: 10em;
  background-color: var(--card-bg);
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 250ms;
  cursor: pointer;
}

.toggle-checkbox:checked ~ .toggle-slot {
  background-color: #374151;
  border-color: #374151;
}

.toggle-button {
  transform: translate(2.35em, 0.35em);
  position: absolute;
  height: 1.3em;
  width: 1.3em;
  border-radius: 50%;
  background-color: #ffeccf;
  box-shadow: inset 0px 0px 0px 0.15em #ffbb52;
  transition: background-color 250ms, border-color 250ms, transform 500ms cubic-bezier(.26,2,.46,.71);
}

.toggle-checkbox:checked ~ .toggle-slot .toggle-button {
  background-color: #485367;
  box-shadow: inset 0px 0px 0px 0.15em white;
  transform: translate(0.35em, 0.35em);
}

.sun-icon {
  position: absolute;
  height: 1.2em;
  width: 1.2em;
  color: #ffbb52;
}

.sun-icon-wrapper {
  position: absolute;
  height: 1.2em;
  width: 1.2em;
  opacity: 1;
  transform: translate(0.4em, 0.4em) rotate(15deg);
  transform-origin: 50% 50%;
  transition: opacity 150ms, transform 500ms cubic-bezier(.26,2,.46,.71);
}

.toggle-checkbox:checked ~ .toggle-slot .sun-icon-wrapper {
  opacity: 0;
  transform: translate(0.6em, 0.4em) rotate(0deg);
}

.moon-icon {
  position: absolute;
  height: 1.2em;
  width: 1.2em;
  color: white;
}

.moon-icon-wrapper {
  position: absolute;
  height: 1.2em;
  width: 1.2em;
  opacity: 0;
  transform: translate(2.2em, 0.4em) rotate(0deg);
  transform-origin: 50% 50%;
  transition: opacity 150ms, transform 500ms cubic-bezier(.26,2.5,.46,.71);
}

.toggle-checkbox:checked ~ .toggle-slot .moon-icon-wrapper {
  opacity: 1;
  transform: translate(2.4em, 0.4em) rotate(-15deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .theme-toggle-wrapper {
    margin: 0 0.5rem;
  }
  
  .toggle-slot {
    height: 1.8em;
    width: 3.6em;
  }
  
  .toggle-button {
    height: 1.2em;
    width: 1.2em;
    transform: translate(2.1em, 0.3em);
  }
  
  .toggle-checkbox:checked ~ .toggle-slot .toggle-button {
    transform: translate(0.3em, 0.3em);
  }
}

/* Profile Section */
.profile-container {
  max-width: 900px;
  margin: 0 auto;
}

.profile-header {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-strong);
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  position: relative;
}

.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.level-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  border: 3px solid var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-info h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.profile-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.profile-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Level Progress */
.level-progress-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.level-progress-section h3 {
  color: var(--text);
  margin-bottom: 1.5rem;
}

.level-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--text);
}

.level-progress-bar {
  height: 20px;
  background: var(--background-alt);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.level-progress-fill {
  height: 100%;
  background: var(--gradient-btn);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.level-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 30px 30px;
  animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 30px 30px;
  }
}

.xp-info {
  text-align: center;
  color: var(--text-secondary);
}

/* Achievements */
.achievements-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.achievements-section h3 {
  color: var(--text);
  margin-bottom: 1.5rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.achievement-item {
  text-align: center;
  padding: 1rem;
  border-radius: 10px;
  background: var(--background-alt);
  transition: all 0.3s ease;
}

.achievement-item.unlocked {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.achievement-item.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.achievement-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.achievement-description {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Stats Grid */
.stats-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.stats-section h3 {
  color: var(--text);
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--background-alt);
  padding: 1.5rem;
  border-radius: 10px;
  text-align: center;
}

.stat-card h4 {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: normal;
}

.stat-number {
  color: var(--primary);
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

/* Recent Activity */
.recent-activity {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.recent-activity h3 {
  color: var(--text);
  margin-bottom: 1.5rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background-alt);
  border-radius: 10px;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-details {
  flex: 1;
}

.activity-title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.activity-time {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-stats {
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Practice Mode Toggle */
.practice-mode-toggle {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}

.practice-mode-toggle h3 {
  color: var(--text);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.switch-label {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 38px;
}

.switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
  transition: all 0.4s ease;
  border-radius: 34px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 30px;
  width: 30px;
  left: 4px;
  bottom: 4px;
  background: white;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background: var(--gradient-btn);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.4);
}

input:checked + .slider:before {
  transform: translateX(32px);
}

.mode-description-box {
  background: var(--background-alt);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  border-left: 4px solid var(--primary);
}

.mode-text {
  margin-left: 70px;
  font-weight: 600;
  color: var(--text);
}

.mode-label-left,
.mode-label-right {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.mode-label-left.active,
.mode-label-right.active {
  color: var(--primary);
  font-size: 1.1rem;
}

.mode-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background);
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 2rem;
    animation: slideUp 0.3s ease-out;
}

.cookie-consent-banner.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-consent-content {
    max-width: 800px;
    margin: 0 auto;
}

.cookie-consent-content h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.cookie-categories {
    margin: 1.5rem 0;
}

.cookie-category {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 8px;
}

.cookie-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.cookie-switch input[type="checkbox"] {
    display: none;
}

.cookie-slider {
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 34px;
    position: relative;
    transition: 0.3s;
    margin-right: 1rem;
}

.cookie-slider:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.cookie-switch input:checked + .cookie-slider {
    background-color: var(--primary);
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(24px);
}

.cookie-switch input:disabled + .cookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-label {
    font-weight: 600;
}

.cookie-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.cookie-policy-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cookie-policy-link a {
    color: var(--primary);
    text-decoration: underline;
}

/* Dark mode support */
.dark-mode .cookie-consent-banner {
    background: var(--background);
    border-top-color: var(--primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 1.5rem 1rem;
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .cookie-actions button {
        width: 100%;
    }
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    z-index: 9999;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-consent-content {
    max-width: 800px;
    margin: 0 auto;
}

.cookie-categories {
    margin: 1.5rem 0;
}

.cookie-category {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.cookie-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cookie-switch input[type="checkbox"] {
    margin-right: 0.5rem;
}

.cookie-switch input[disabled] {
    cursor: not-allowed;
}

.cookie-description {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.cookie-policy-link {
    font-size: 0.875rem;
    margin-top: 1rem;
    color: #666;
}

.cookie-policy-link a {
    color: var(--primary);
    text-decoration: none;
}

.cookie-policy-link a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .cookie-actions {
        flex-direction: column;
    }
    
    .cookie-actions button {
        width: 100%;
    }
}

.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.leaderboard-tab {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.leaderboard-tab:hover {
    background: var(--primary-light);
}

.leaderboard-tab.active {
    background: var(--primary);
    color: white;
}

.leaderboard-info {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Ntore styles */
.store-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.coin-balance-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ffb347, #ffcc33);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: white;
}

.coin-balance {
    font-size: 1.8rem;
    font-weight: bold;
}

.coin-icon {
    font-size: 2.5rem;
}

.earn-coins-section {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.earn-coins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.earn-coin-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.earn-coin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.earn-coin-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ff6b35;
}

.earn-coin-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff6b35;
    margin: 0.5rem 0;
}

.store-items-section {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.store-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.store-item {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.store-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.premium-badge {
    position: absolute;
    top: 10px;
    right: -30px;
    background: #ff6b35;
    color: white;
    padding: 0.3rem 2rem;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: bold;
}

.store-item-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ff6b35;
}

.item-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.coin-icon-small {
    font-size: 1.5rem;
    color: #ffcc00;
}

.buy-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.buy-btn:hover {
    background: #e55a28;
}

.buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.transaction-history {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.transaction-list {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.transaction-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.transaction-positive {
    color: #27ae60;
}

.transaction-negative {
    color: #e74c3c;
}

body.dark-mode input:checked + .slider {
  background: var(--gradient-btn);
  box-shadow: 0 0 12px rgba(74, 144, 226, 0.4);
}

/* Dark mode adjustments */
body.dark-mode .earn-coins-section,
body.dark-mode .store-items-section,
body.dark-mode .transaction-history {
    background: #0f3460;
    color: #e8e8e8;
}

body.dark-mode .earn-coin-card,
body.dark-mode .store-item {
    background: #16213e;
    border-color: #1a3460;
}

/* Language Selector Styles */
.lang-selector {
    position: relative;
    margin-right: 0.5rem; /* REDUCED */
    display: inline-block;
    flex-shrink: 0;
}

.lang-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text);
    font-size: 0.9rem; /* SMALLER */
    white-space: nowrap;
}

.lang-button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.lang-flag-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lang-code {
    font-weight: 600;
    color: var(--primary);
    transition: color 0.3s ease;
}

.lang-button:hover .lang-code {
    color: white !important;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text);
}

.lang-option:hover {
    background: var(--primary);
    color: white;
}

.lang-option:first-child {
    border-radius: 6px 6px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 6px 6px;
}

.lang-option iconify-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.lang-dropdown.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

/* Dark mode support */
.dark-mode .lang-button,
.dark-mode .lang-dropdown {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.dark-mode .lang-option:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .lang-selector {
        margin-right: 0.5rem;
    }
    
    .lang-button {
        padding: 0.4rem 0.8rem;
    }
    
    .lang-dropdown {
        min-width: 180px;
    }
}

/* ===================================
   HEADER SEARCH BAR
   =================================== */

.header-search-wrapper {
    flex: 1 1 auto; /* CHANGED - allows it to grow */
    max-width: 600px;
    min-width: 250px; /* INCREASED from 200px */
    margin: 0 1rem;
}

.header-search-wrapper[style*="display: none"],
.header-search-wrapper.hidden {
    display: none !important;
    flex: 0 0 0;
    min-width: 0;
    max-width: 0;
    margin: 0;
    padding: 0;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    width: 100%; /* ADD THIS */
}

.header-search:focus-within {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.header-search iconify-icon {
    font-size: 1.3rem;
    color: #666;
    margin-right: 0.5rem;
    flex-shrink: 0; /* ADD THIS */
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: var(--text);
    min-width: 0; /* ADD THIS - allows input to shrink */
}

.header-search input::placeholder {
    color: #999;
}

/* ===================================
   LEVEL DISPLAY WITH HOVER TOOLTIP
   =================================== */

.level-display {
  position: relative;
  margin-right: 0.5rem; /* REDUCED */
  cursor: help;
  flex-shrink: 0;
}

.level-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.3rem 0.7rem; /* SMALLER */
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem; /* SMALLER */
    min-width: 50px; /* SMALLER */
    transition: all 0.3s ease;
}

.level-display:hover .level-text {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.level-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1rem;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.level-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--primary);
}

.level-display:hover .level-text {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.tooltip-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.tooltip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tooltip-text {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0;
    text-align: center;
}

.tooltip-percentage {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: bold;
    margin: 0;
    text-align: center;
}

/* ===================================
   STREAK DISPLAY
   =================================== */

.streak-display {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1rem; /* SMALLER */
  font-weight: bold;
  color: var(--text-primary);
  margin-right: 0.5rem; /* REDUCED */
  padding: 0.3rem 0.7rem; /* SMALLER */
  background: #fff3e0;
  border-radius: 20px;
  border: 2px solid #ffb74d;
  flex-shrink: 0;
  white-space: nowrap;
}

.dark-mode .streak-display {
    background: #4a3600;
    border-color: #ff9800;
}

/* ===================================
   USER MENU DROPDOWN
   =================================== */

.user-menu-dropdown {
    position: relative;
    flex-shrink: 0;
}

.user-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--primary);
    font-size: 1.5rem;
}

.user-menu-button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.user-menu-content {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    min-width: 320px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-content.hidden {
    display: none;
}

/* User Info Header */
.user-menu-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-details h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.user-details p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
    color: white;
}

/* Menu Sections */
.menu-section {
    padding: 1rem;
}

.menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 0.75rem 0;
    letter-spacing: 0.5px;
}

.lang-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.lang-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 600;
}

.lang-option-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.lang-option-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.lang-option-btn iconify-icon {
    font-size: 1.5rem;
}

.menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
}

.user-menu-item:hover {
    background: var(--background-alt);
}

.user-menu-item iconify-icon {
    font-size: 1.3rem;
    color: var(--primary);
}

.settings-item {
    justify-content: space-between;
}

.logout-item {
    color: #e74c3c;
}

.logout-item:hover {
    background: #fee;
}

.logout-item iconify-icon {
    color: #e74c3c;
}

/* Compact Toggle Switch */
.theme-toggle-compact {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-slot-compact {
    position: relative;
    height: 24px;
    width: 44px;
    border: 2px solid #e4e7ec;
    border-radius: 12px;
    background-color: #f5f5f5;
    transition: all 250ms;
}

.toggle-button-compact {
    transform: translate(2px, 2px);
    position: absolute;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 250ms;
}

.toggle-checkbox:checked ~ .toggle-slot-compact {
    background-color: var(--primary);
    border-color: var(--primary);
}

.toggle-checkbox:checked ~ .toggle-slot-compact .toggle-button-compact {
    transform: translate(22px, 2px);
}

/* Dark Mode Support */
.dark-mode .header-search {
    background: #2a2a2a;
}

.dark-mode .header-search:focus-within {
    background: #333;
}

.dark-mode .header-search input {
    color: white;
}

.dark-mode .level-tooltip,
.dark-mode .user-menu-content {
    background: var(--card-bg) !important;
    border-color: var(--primary);
    color: var(--text);
}

.dark-mode .tooltip-text {
    color: #ccc;
}

.dark-mode .user-menu-item:hover {
    background: var(--background-alt);
}

.dark-mode .menu-divider {
    background: #444;
}

.dark-mode .lang-option-btn {
    background: var(--input-bg);
    border-color: #444;
    color: var(--text);
}

.dark-mode .lang-option-btn:hover {
    background: rgba(79, 70, 229, 0.2);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .header-search-wrapper {
        margin: 0 1rem;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .header-search-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .level-display,
    .streak-display {
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }
    
    .user-menu-content {
        min-width: 280px;
        right: -10px;
    }
    
    .level-tooltip {
        left: auto;
        right: 0;
        transform: none;
    }
    
    .level-tooltip::before {
        left: auto;
        right: 20px;
        transform: none;
    }
}

.dark-mode .user-menu-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
}

.dark-mode .lang-option-btn {
    background: var(--input-bg);
    border-color: #444;
    color: var(--text);
}

.dark-mode .lang-option-btn:hover {
    background: rgba(74, 144, 226, 0.2);
}

.dark-mode .lang-option-btn.active {
    background: var(--primary);
    color: white;
}

/* Make profile button more obvious */
.user-menu-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
}

/* Add pulsing animation to draw attention */
.user-menu-button::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50px;
    border: 2px solid var(--primary);
    opacity: 0;
    animation: profilePulse 2s ease-in-out infinite;
}

@keyframes profilePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

/* Stop pulsing after first click */
.user-menu-button.clicked::after {
    animation: none;
}

/* Make chevron bounce on hover */
.user-menu-button:hover iconify-icon[icon="mdi:chevron-down"] {
    animation: chevronBounce 0.6s ease-in-out infinite;
}

@keyframes chevronBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

/* Enhanced hover state */
.user-menu-button:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Dark mode button */
.dark-mode .user-menu-button {
    border-color: var(--primary);
    color: var(--primary);
}

.dark-mode .user-menu-button:hover {
    background: var(--primary);
    color: white;
}

.dark-mode .user-menu-button::after {
    border-color: var(--primary);
}

/* Add tooltip hint */
.user-menu-button[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1001;
}

.user-menu-button[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.user-menu-button:hover[data-tooltip]::before,
.user-menu-button:hover[data-tooltip]::after {
    opacity: 1;
    visibility: visible;
}

/* Make Verbify logo clickable and styled */
.nav-brand a.brand-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.nav-brand a.brand-link:hover {
    opacity: 0.8;
}

.nav-brand a.brand-link h1 {
    margin: 0;
    cursor: pointer;
}

/* Donate Button Styling */
.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem; /* SMALLER */
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.9rem; /* SMALLER */
}

.btn-donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn-donate iconify-icon {
    font-size: 1.2rem;
    /* No heartbeat animation - removed */
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

body.dark-mode .btn-donate {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

body.dark-mode .btn-donate:hover {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .btn-donate {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .btn-donate iconify-icon {
        font-size: 1rem;
    }
}

/* Search Loading Indicator */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

body.dark-mode .spinner-small {
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-top: 2px solid var(--primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Search button disabled state */
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Make navbar button text shorter on mobile */
@media (max-width: 768px) {
    #nav-create-verbify-btn span {
        display: none;
    }
    
    #nav-create-verbify-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 0.75rem; /* Ensure it stays compact */
    }
    
    #nav-create-verbify-btn iconify-icon {
        margin-right: 0 !important;
        font-size: 1.2rem;
    }
}

.verb-tag-invalid {
  background: #fff3cd !important;
  border-color: #ffc107 !important;
  color: #856404 !important;
}

.verb-tag-invalid .remove-verb {
  color: #856404 !important;
}

.verb-tag-invalid {
  background: #fff3cd !important;
  border: 1px solid #ffc107 !important;
  color: #856404 !important;
}

.verb-tag-invalid .remove-verb {
  color: #856404 !important;
}

/* ========================================
   CREDITS PAGE STYLES - ADD TO EXISTING styles.css
   ======================================== */

/* Credits Page Layout */
.credits-page {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.credits-container {
  max-width: 900px;
  margin: 0 auto;
}

.credits-container h1 {
  color: var(--primary);
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  background: var(--gradient-btn);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Legal Sections */
.legal-section {
  margin-bottom: 3rem;
}

.legal-section h2 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.legal-section h3 {
  color: var(--text);
  font-size: 1.3rem;
  margin: 1.5rem 0 1rem;
  font-weight: 600;
}

.legal-section h4 {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* Info Boxes */
.info-box, 
.attribution-box {
  background: var(--background-alt);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.info-box p {
  margin: 0.75rem 0;
  color: var(--text);
  line-height: 1.6;
}

.info-box strong {
  color: var(--primary);
}

.info-box ul {
  margin-left: 2rem;
  margin-top: 0.75rem;
}

.info-box ul li {
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.6;
}

.attribution-box h4 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* Special Boxes */
.disclaimer {
  background: rgba(255, 107, 53, 0.1);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  margin-top: 1rem;
  font-style: italic;
}

.important-box {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(255, 140, 66, 0.08) 100%);
  border: 2px solid var(--primary);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.1);
}

.info-highlight {
  background: rgba(255, 107, 53, 0.1);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  text-align: center;
  border: 1px solid var(--primary);
}

.info-highlight a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.info-highlight a:hover {
  text-decoration: underline;
  color: var(--primary-light);
}

/* Email Box */
.email-box {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  text-align: center;
  border: 1px solid var(--border);
}

.email-box a {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  word-break: break-all;
}

.email-box a:hover {
  text-decoration: underline;
  color: var(--primary-light);
}

/* Response Time */
.response-time {
  background: var(--background);
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  border: 1px solid var(--border);
}

#auth-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Authority Box */
.authority-box {
  background: var(--background);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border: 1px solid var(--border);
}

.authority-box p {
  margin: 0.5rem 0;
  color: var(--text);
}

.authority-box strong {
  color: var(--primary);
}

.authority-box a {
  color: var(--primary);
  text-decoration: none;
}

.authority-box a:hover {
  text-decoration: underline;
}

/* Contact Box */
.contact-box {
  background: linear-gradient(135deg, var(--background-alt) 0%, var(--background) 100%);
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.contact-method {
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.contact-method:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

.contact-method h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.contact-method p {
  margin: 0.5rem 0;
  color: var(--text);
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
  display: inline-block;
  padding: 0.5rem;
  background: var(--background-alt);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.contact-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* Cookie Table */
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}

.cookie-table th {
  background: var(--primary);
  color: white;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
}

.cookie-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.cookie-table tr:hover {
  background: var(--background-alt);
}

/* Last Updated */
.last-updated {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.version-info {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Dark Mode Adjustments for Credits Page */
body.dark-mode .info-box,
body.dark-mode .attribution-box {
  background: var(--background-alt);
  border-color: var(--border);
}

body.dark-mode .disclaimer {
  background: rgba(74, 144, 226, 0.1);
  border-left-color: var(--primary);
}

body.dark-mode .important-box {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(91, 160, 242, 0.08) 100%);
  border-color: var(--primary);
}

body.dark-mode .email-box {
  background: var(--background-alt);
}

body.dark-mode .authority-box {
  background: var(--background-alt);
}

body.dark-mode .info-highlight {
  background: rgba(74, 144, 226, 0.1);
  border-color: var(--primary);
}

body.dark-mode .contact-method {
  background: var(--background-alt);
}

body.dark-mode .contact-link {
  background: var(--background);
}

body.dark-mode .contact-link:hover {
  background: var(--primary);
}

body.dark-mode .cookie-table {
  background: var(--card-bg);
}

body.dark-mode .cookie-table th {
  background: var(--primary);
}

/* Responsive Design for Credits Page */
@media (max-width: 768px) {
  .credits-container {
    padding: 0 1rem;
  }

  .credits-container h1 {
    font-size: 2rem;
  }

  .legal-section h2 {
    font-size: 1.5rem;
  }

  .legal-section h3 {
    font-size: 1.2rem;
  }

  .email-box a {
    font-size: 0.9rem;
  }

  .contact-methods {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cookie-table {
    font-size: 0.85rem;
  }

  .cookie-table th,
  .cookie-table td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .credits-container h1 {
    font-size: 1.75rem;
  }

  .legal-section h2 {
    font-size: 1.3rem;
  }

  .info-box,
  .attribution-box {
    padding: 1rem;
  }

  .contact-method {
    padding: 1rem;
  }
}

/* Language selector chevron */
.lang-button iconify-icon:last-child {
    transition: transform 0.3s ease;
}

.lang-dropdown:not(.hidden) + .lang-button iconify-icon:last-child,
.lang-button:hover iconify-icon:last-child {
    transform: rotate(180deg);
}

/* Improved responsive design */
@media (max-width: 968px) {
    .header-search-wrapper {
        margin: 0 0.5rem; /* Reduce margin */
        max-width: 300px; /* Make smaller */
    }
    
    .nav-container {
        gap: 0.5rem; /* Reduce gap */
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0.75rem 1rem; /* Reduce padding */
    }
    
    .nav-brand {
        order: 1;
    }
    
    .nav-menu {
        order: 2;
        margin-left: auto; /* Push to right */
    }
    
    .header-search-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .level-display,
    .streak-display {
        font-size: 0.9rem;
        margin-right: 0.5rem;
        padding: 0.3rem 0.6rem; /* Reduce padding */
    }
    
    .user-menu-content {
        min-width: 280px;
        right: -10px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .nav-brand {
        flex: 1 0 auto; /* Takes available space */
        margin-right: 0;
    }
    
    .nav-menu {
        flex: 0 0 auto;
        margin-left: 0;
    }
    
    .header-search-wrapper {
        order: 10; /* Push to new row */
        flex: 1 0 100%;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .level-display,
    .streak-display {
        font-size: 0.85rem;
        margin-right: 0.5rem;
        padding: 0.3rem 0.6rem;
    }
    
    .btn-donate {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    .nav-container {
        gap: 0.5rem;
    }
    
    .header-search-wrapper {
        max-width: 400px;
        min-width: 200px;
    }
}

@media (max-width: 968px) {
    .header-search-wrapper {
        max-width: 300px;
        min-width: 150px;
    }
    
    .level-display,
    .streak-display,
    .btn-donate {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }
    
    .nav-brand {
        flex: 1 0 auto;
        order: 1;
    }
    
    .nav-menu {
        order: 2;
        margin-left: 0;
    }
    
    .header-search-wrapper {
        order: 10;
        flex: 1 0 100%;
        width: 100%;
        max-width: 100%;
        margin: 0.5rem 0 0 0;
    }
}

.dark-mode .lang-button {
    background: var(--card-bg);
    border-color: var(--primary);
}

.dark-mode .lang-dropdown {
    background: var(--card-bg);
    border-color: var(--primary);
}

/* Dark Mode Enhancements */
body.dark-mode .practice-header,
body.dark-mode .practice-mode-toggle,
body.dark-mode .practice-question,
body.dark-mode .practice-complete {
  background: var(--card-bg);
  border-color: var(--border);
}

body.dark-mode .score-display {
  background: linear-gradient(135deg, var(--background-alt) 0%, var(--background) 100%);
}

body.dark-mode .mode-description-box {
  background: var(--background-alt);
  border-left-color: var(--primary);
}