: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: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-name {
  color: var(--text);
  font-weight: 600;
  margin-right: 1rem;
}

#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;
}

/* Practice Section */
.practice-container {
  max-width: 800px;
  margin: 0 auto;
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.practice-header h2 {
  color: var(--text);
  font-size: 2rem;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.score-display span {
  font-weight: 600;
  color: var(--text);
}

#score-percentage {
  font-size: 1.2rem;
  color: var(--primary);
}

.practice-question {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--card-text);
}

.verb-display {
  font-size: 2.5rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 1rem;
}

.tense-display {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.pronoun-display {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 600;
}

.answer-section {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

#answer-input {
  padding: 1rem;
  font-size: 1.2rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
  text-align: center;
  background: var(--input-bg);
  color: var(--input-text);
}

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

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

/* Feedback */
.feedback {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  animation: slideDown 0.3s ease;
  box-shadow: var(--shadow-strong);
  position: relative;
  z-index: 10;
}

.feedback.correct {
  background: #d4edda;
  border: 2px solid var(--success);
  color: #155724;
}

body.dark-mode .feedback.correct {
  background: rgba(39, 174, 96, 0.2);
  border: 2px solid var(--success);
  color: #27ae60;
}

.feedback.incorrect {
  background: #f8d7da;
  border: 2px solid var(--error);
  color: #721c24;
}

body.dark-mode .feedback.incorrect {
  background: rgba(231, 76, 60, 0.2);
  border: 2px solid var(--error);
  color: #e74c3c;
}

#feedback-message {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

#correct-answer {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  display: inline-block;
}

/* Practice Complete */
.practice-complete {
  text-align: center;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
  color: var(--card-text);
}

.practice-complete h3 {
  color: var(--text);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.final-score {
  margin-bottom: 2rem;
}

.final-score div {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.final-score span {
  font-weight: 600;
  color: var(--primary);
}

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

/* 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);
  }
}

/* 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);
}

#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 {
  margin: 2rem auto;
  text-align: center;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

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

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

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

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

/* 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;
}

/* 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;
}

/* Leaderboard styling (optional) */
.lb-row { display:flex; align-items:center; justify-content:space-between; padding:0.75rem 1rem; border:1px solid var(--border); border-radius:12px; margin-bottom:0.5rem; background:var(--card-bg); box-shadow:var(--shadow); }
.lb-rank { font-weight:800; color:var(--primary); width:3rem; text-align:center; }
.lb-user { display:flex; align-items:center; gap:0.75rem; flex:1; min-width:0; }
.lb-avatar { width:32px; height:32px; border-radius:50%; background:#ddd; flex:0 0 auto; }
.lb-avatar.placeholder { background:linear-gradient(135deg,#eee,#ddd); }
.lb-name { font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lb-score { font-weight:700; color:var(--text); min-width:3rem; text-align:right; }
