/* Dashboard Styles for Management Pages */

/* Navigation Sections */
.nav-section {
  display: flex;
  gap: 1rem;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e8ed;
  transition: all 0.3s ease;
  position: relative;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.category-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.category-icon {
  font-size: 2rem;
  margin-right: 1rem;
  color: #3498db;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
}

.category-description {
  color: #7f8c8d;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.category-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #95a5a6;
}

.category-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Words Table */
.words-table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.words-table {
  width: 100%;
  border-collapse: collapse;
}

.words-table th {
  background: #f8f9fa;
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 1px solid #dee2e6;
  font-size: 0.9rem;
}

.words-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
  font-size: 0.9rem;
}

.words-table tr:hover {
  background: #f8f9fa;
}

.word-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.word-actions .btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}

/* Quiz Enhancements */
.quiz-setup {
  background: #ffffff;
  padding: 2.25rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  border: 1px solid #e9ecef;
  max-width: 760px;
  margin: 0 auto;
}

.quiz-setup h2 {
  margin: 0 0 1.25rem 0;
  color: #1f2937;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.quiz-option-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
}

.quiz-option-group label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #34495e;
  font-weight: 600;
}

.quiz-option-group select {
  height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.98rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.quiz-option-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.12);
}

.quiz-setup .btn.btn-primary {
  min-width: 220px;
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 18px rgba(52, 152, 219, 0.25);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.quiz-setup .btn.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(52, 152, 219, 0.3);
}

.quiz-container {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #ecf0f1;
}

.quiz-info {
  display: flex;
  gap: 2rem;
}

.quiz-progress,
.quiz-score {
  font-weight: 600;
  color: #2c3e50;
}

.quiz-timer {
  background: #e74c3c;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

.quiz-progress-bar {
  background: #ecf0f1;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, #3498db, #2ecc71);
  height: 100%;
  transition: width 0.3s ease;
  width: 0%;
}

.question-card {
  text-align: center;
  padding: 2rem;
  margin-bottom: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.question-type {
  color: #7f8c8d;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.question-word {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.question-pronunciation {
  color: #7f8c8d;
  font-style: italic;
  font-size: 1.2rem;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.answer-option {
  background: white;
  border: 2px solid #dee2e6;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 500;
}

.answer-option:hover {
  border-color: #3498db;
  background: #f0f9ff;
}

.answer-option.selected {
  border-color: #3498db;
  background: #3498db;
  color: white;
}

.answer-option.correct {
  border-color: #27ae60;
  background: #27ae60;
  color: white;
}

.answer-option.incorrect {
  border-color: #e74c3c;
  background: #e74c3c;
  color: white;
}

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

/* Quiz Results */
.quiz-result {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.result-header {
  margin-bottom: 2rem;
}

.result-score-circle {
  margin: 2rem 0;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#3498db 0deg, #e0e6ed 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 50%;
}

.score-circle span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  z-index: 1;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.stat-card {
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.correct {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #b8dacc;
}

.stat-card.incorrect {
  background: linear-gradient(135deg, #f8d7da 0%, #f1b9c0 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.stat-card.time {
  background: linear-gradient(135deg, #d1ecf1 0%, #b8daff 100%);
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.stat-card.streak {
  background: linear-gradient(135deg, #ffe6cc 0%, #ffb366 100%);
  color: #cc5500;
  border: 1px solid #ffc999;
}

.stat-card.streak.active {
  background: linear-gradient(135deg, #ffcccc 0%, #ff6666 100%);
  color: #cc0000;
  border: 1px solid #ff9999;
}

.stat-sublabel {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Streak notification animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Activity Calendar (GitHub-style) */
.activity-section {
  margin-top: 0;
  padding: 1rem;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.activity-section h3 {
  display: none;
}

.github-calendar-wrapper {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  overflow-x: auto;
  padding: 8px;
  display: grid;
  grid-template-areas:
    '. months'
    'days calendar';
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: 3px;
}

.month-labels {
  grid-area: months;
  display: grid;
  gap: 2px;
  height: 15px;
  align-items: end;
  margin-bottom: 2px;
  margin-left: 2px;
}

.month-label {
  font-size: 10px;
  color: #656d76;
  font-weight: 400;
  white-space: nowrap;
  text-align: left;
}

.day-labels {
  grid-area: days;
  display: grid;
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
  margin-right: 4px;
  width: 18px;
}

.day-labels > div {
  font-size: 10px;
  color: #656d76;
  text-align: right;
  font-weight: 400;
  line-height: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.calendar-grid {
  grid-area: calendar;
  display: grid;
  gap: 3px;
  grid-template-rows: repeat(7, 14px);
}

.activity-day {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(27, 31, 35, 0.06);
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.activity-day:hover {
  border: 1px solid rgba(27, 31, 35, 0.15);
  transform: scale(1.2);
}

.activity-day.level-0 {
  background-color: #ebedf0;
}

.activity-day.level-1 {
  background-color: #9be9a8;
}

.activity-day.level-2 {
  background-color: #40c463;
}

.activity-day.level-3 {
  background-color: #30a14e;
}

.activity-day.level-4 {
  background-color: #216e39;
}

.activity-day.empty {
  background-color: transparent;
  border: none;
  cursor: default;
}

.activity-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 9px;
  color: #656d76;
  margin-top: 5px;
}

.legend-levels {
  display: flex;
  gap: 2px;
  margin: 0 4px;
}

.legend-levels .activity-day {
  border: 1px solid rgba(27, 31, 35, 0.06);
}

@media (max-width: 768px) {
  .github-calendar-wrapper {
    padding: 6px;
  }

  .calendar-grid {
    grid-template-rows: repeat(7, 12px);
    gap: 2px;
  }

  .activity-day {
    width: 12px;
    height: 12px;
  }

  .day-labels {
    grid-template-rows: repeat(7, 12px);
    gap: 2px;
    width: 16px;
  }

  .day-labels > div {
    font-size: 9px;
    line-height: 12px;
  }

  .month-label {
    font-size: 9px;
  }
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.8;
}

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

/* Form Enhancements */
.modal-large .modal-content {
  max-width: 800px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-help {
  font-size: 0.8rem;
  color: #7f8c8d;
  margin-top: 0.25rem;
}

/* Button Enhancements */
.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: #f8f9fa;
}

.pagination button.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .quiz-option-group {
    grid-template-columns: 1fr;
  }

  .quiz-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .quiz-info {
    justify-content: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .result-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .answer-options {
    grid-template-columns: 1fr;
  }

  .nav-section {
    flex-direction: column;
    gap: 0.5rem;
  }
}

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

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #e0e6ed;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Animation for section transitions */
.section {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.section.active {
  opacity: 1;
  transform: translateY(0);
}

/* Required field indicator */
.required {
  color: #e74c3c;
  font-weight: bold;
}

/* Form validation styles */
.form-group input:invalid,
.form-group textarea:invalid,
.form-group select:invalid {
  border-color: #e74c3c;
}

.form-group input:valid,
.form-group textarea:valid,
.form-group select:valid {
  border-color: #27ae60;
}

/* Optional field styling */
.form-group input:not([required]),
.form-group textarea:not([required]),
.form-group select:not([required]) {
  border-color: #bdc3c7;
}

/* Flashcard Quiz Styles */
.flashcard-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  perspective: 1000px;
}

.flashcard {
  width: 400px;
  height: 300px;
  position: relative;
  cursor: pointer;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
}

.flashcard.transitioning {
  transition:
    opacity 0.3s ease,
    transform 0.6s ease-in-out;
}

.flashcard.slide-out-left {
  transform: translateX(-100%) scale(0.8) rotateY(0deg);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;
}

.flashcard.slide-out-right {
  transform: translateX(100%) scale(0.8) rotateY(0deg);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;
}

.flashcard.slide-in-left {
  transform: translateX(-100%) scale(0.8) rotateY(0deg);
  opacity: 0;
}

.flashcard.slide-in-right {
  transform: translateX(100%) scale(0.8) rotateY(0deg);
  opacity: 0;
}

.flashcard.slide-active {
  transform: translateX(0) scale(1) rotateY(0deg);
  opacity: 1;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard.flipped.slide-out-left {
  transform: translateX(-100%) scale(0.8) rotateY(180deg);
}

.flashcard.flipped.slide-out-right {
  transform: translateX(100%) scale(0.8) rotateY(180deg);
}

.flashcard.flipped.slide-in-left {
  transform: translateX(-100%) scale(0.8) rotateY(180deg);
}

.flashcard.flipped.slide-in-right {
  transform: translateX(100%) scale(0.8) rotateY(180deg);
}

.flashcard.flipped.slide-active {
  transform: translateX(0) scale(1) rotateY(180deg);
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  box-sizing: border-box;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.flashcard-back {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  transform: rotateY(180deg);
}

.card-label {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-content {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  line-height: 1.2;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-pronunciation {
  font-size: 1.2rem;
  font-style: italic;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.card-extra {
  margin-top: 1rem;
  opacity: 0.9;
  max-height: 100px;
  overflow-y: auto;
}

.card-definition,
.card-example {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-definition:before {
  content: 'Định nghĩa: ';
  font-weight: bold;
}

.card-example:before {
  content: 'Ví dụ: ';
  font-weight: bold;
}

.flip-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  opacity: 0.7;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.flashcard-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.flashcard-actions .btn {
  min-width: 120px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.flashcard-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quiz-navigation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.quiz-navigation .btn {
  min-width: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .flashcard {
    width: 320px;
    height: 250px;
  }

  .card-content {
    font-size: 1.5rem;
  }

  .flashcard-actions {
    flex-direction: column;
    align-items: center;
  }

  .flashcard-actions .btn {
    width: 200px;
  }

  .quiz-navigation {
    flex-direction: column;
    align-items: center;
  }

  .quiz-navigation .btn {
    width: 200px;
  }
}

/* Vocabulary Games Styles */
.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.game-setup {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.game-setup h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  text-align: center;
}

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

.game-option {
  text-align: center;
}

.game-option label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #34495e;
}

.game-option select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
}

.game-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.game-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

.game-btn.matching {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.game-btn.typing {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Matching Game Styles */
.matching-game {
  display: none;
}

.game-header {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.game-stats {
  display: flex;
  gap: 2rem;
  align-items: center;
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
}

.stat-label {
  font-size: 0.9rem;
  color: #7f8c8d;
}

.game-timer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #e74c3c;
}

.game-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.pause-btn {
  background: #f39c12;
  color: white;
}

.reset-btn {
  background: #95a5a6;
  color: white;
}

.matching-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.words-column,
.meanings-column {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.column-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e1e8ed;
}

.match-card {
  background: #f8f9fa;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.match-card:hover {
  background: #e9ecef;
  border-color: #3498db;
}

.match-card.selected {
  background: #3498db;
  color: white;
  border-color: #2980b9;
}

.match-card.matched {
  background: #d4edda;
  border-color: #27ae60;
  color: #155724;
  cursor: default;
  opacity: 0.7;
}

.match-card.wrong {
  background: #f8d7da;
  border-color: #e74c3c;
  color: #721c24;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.word {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pronunciation {
  font-size: 0.9rem;
  color: #7f8c8d;
  font-style: italic;
}

.meaning {
  font-size: 1rem;
  line-height: 1.4;
}

/* Typing Game Styles */
.typing-game {
  display: none;
}

.typing-area {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  text-align: center;
}

.typing-progress {
  background: #e1e8ed;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.typing-progress-bar {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.word-info {
  margin-bottom: 2rem;
}

.current-meaning {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.current-definition {
  font-size: 1rem;
  color: #7f8c8d;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.current-example {
  font-size: 0.9rem;
  color: #95a5a6;
  font-style: italic;
}

.typing-input-area {
  margin-bottom: 2rem;
}

.typing-input {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
  font-size: 1.2rem;
  border: 3px solid #e1e8ed;
  border-radius: 10px;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}

.typing-input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.typing-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.check-btn {
  background: #27ae60;
  color: white;
}

.skip-btn {
  background: #f39c12;
  color: white;
}

.typing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Game Results Styles */
.game-results {
  display: none;
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.game-result-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 2rem;
}

.game-result-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
  position: relative;
}

.game-result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.result-stat {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.result-stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
}

.result-stat-label {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-top: 0.25rem;
}

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

/* Mobile Responsive for Games */
@media (max-width: 768px) {
  .game-container {
    padding: 1rem;
  }

  .matching-area {
    grid-template-columns: 1fr;
  }

  .game-header {
    text-align: center;
  }

  .game-stats {
    justify-content: center;
  }

  .game-buttons,
  .typing-actions,
  .game-result-actions {
    flex-direction: column;
    align-items: center;
  }

  .game-btn,
  .typing-btn {
    width: 100%;
    max-width: 300px;
  }

  .typing-input {
    max-width: 100%;
  }
}

/* ===============================
   DASHBOARD RESPONSIVE DESIGN 
   =============================== */

/* Tablet Styles */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .quiz-option-group {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

/* Medium screen adjustments */
@media (max-width: 1024px) {
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 500px;
  }
}

/* Small screen adjustments */
@media (max-width: 600px) {
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-width: 100%;
  }

  .stat-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .stat-icon {
    font-size: 1.1rem;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Categories Mobile */
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
  }

  .category-card {
    padding: 1rem;
  }

  .category-actions {
    justify-content: center;
  }

  /* Words Table Mobile */
  .words-table-container {
    overflow-x: auto;
    margin-top: 1rem;
  }

  .words-table {
    min-width: 700px;
  }

  .words-table th,
  .words-table td {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .word-actions {
    justify-content: center;
  }

  /* Quiz Mobile */
  .quiz-setup {
    padding: 1rem;
    margin: 1rem;
  }

  .quiz-container {
    padding: 1rem;
    margin: 1rem;
  }

  .quiz-options {
    gap: 1rem;
  }

  .quiz-option-group {
    grid-template-columns: 1fr;
  }

  .question-card {
    padding: 1rem;
  }

  .question-word {
    font-size: 2rem !important;
  }

  .question-options {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .option-btn {
    padding: 1rem;
    font-size: 0.9rem;
  }

  /* Progress */
  .quiz-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .quiz-timer {
    align-self: flex-start;
  }

  /* Pagination Mobile */
  #wordsPagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  #wordsPagination button {
    min-width: 40px;
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
  .category-card {
    padding: 0.8rem;
  }

  .category-title {
    font-size: 1rem;
  }

  .category-meta {
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
  }

  .quiz-setup,
  .quiz-container {
    padding: 0.8rem;
  }

  .question-word {
    font-size: 1.5rem !important;
  }

  .option-btn {
    padding: 0.8rem;
    font-size: 0.8rem;
  }

  .words-table th,
  .words-table td {
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  .btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
}
