/* Additional styles for enhanced responsiveness and animations */

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

/* Enhanced Bootstrap integration */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Ensure text is visible on white backgrounds */
.text-dark {
  color: #212529 !important;
}

.text-muted {
  color: #6c757d !important;
}

/* Custom form styling */
.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Enhanced card styling */
.card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Custom alert styling */
.alert {
  border: none;
  border-radius: 0.5rem;
}

/* Enhanced button styling */
.btn {
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Loading spinner enhancement */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Enhanced mobile navigation */
.nav-mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
}

.nav-mobile .nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.nav-mobile .logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2c3e50;
}

.nav-mobile .menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #3498db;
}

/* Progress indicator */
.progress-container {
  background: #ecf0f1;
  border-radius: 20px;
  height: 8px;
  margin: 20px 0;
  overflow: hidden;
}

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

/* Enhanced tooltips */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .container {
    padding: 15px;
  }

  .quiz-header h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .nav-mobile {
    display: block;
  }

  .quiz-header {
    margin-top: 80px;
    padding: 25px 20px;
  }

  .quiz-header h1 {
    font-size: 1.8rem;
  }

  .question-card {
    margin-bottom: 15px;
  }

  .option-label {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .quiz-header {
    padding: 20px 15px;
  }

  .quiz-header h1 {
    font-size: 1.5rem;
  }

  .question-card {
    padding: 15px 12px;
  }

  .option-label {
    padding: 12px;
    font-size: 0.9rem;
  }

  .submit-btn {
    font-size: 1rem;
    padding: 14px 25px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
  }

  .quiz-header,
  .question-card,
  .submit-container,
  .results-container {
    background: rgba(45, 52, 64, 0.95);
    color: #ecf0f1;
  }

  .question-title {
    color: #3498db;
  }

  .context {
    background: rgba(52, 73, 94, 0.8);
    color: #bdc3c7;
  }

  .question-text {
    color: #bdc3c7;
  }

  .option-label {
    background: rgba(52, 73, 94, 0.8);
    border-color: rgba(149, 165, 166, 0.3);
    color: #ecf0f1;
  }

  .option-label:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .quiz-header,
  .question-card,
  .submit-container,
  .results-container {
    background: white;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .submit-btn,
  .retry-btn,
  .nav-mobile {
    display: none;
  }
}

/* Inline styles extracted from index.html */
* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
}

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

.quiz-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.quiz-header h1 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 700;
}

.quiz-header .subtitle {
  color: #7f8c8d;
  font-size: 1.1rem;
  margin-bottom: 0;
}

.loading {
  text-align: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.question-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.question-number {
  display: inline-block;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-weight: bold;
  margin-right: 12px;
}

.question-title {
  display: inline;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.context {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  font-style: italic;
  color: #5a6c7d;
  border-left: 4px solid #3498db;
}

.question-text {
  font-size: 1.1rem;
  margin: 16px 0;
  line-height: 1.5;
  color: #34495e;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.option {
  position: relative;
}

.option-label {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border: 2px solid #e1e8ed;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  line-height: 1.4;
}

.option-label:hover {
  border-color: #3498db;
  background: #f8f9ff;
}

.option-input {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  accent-color: #3498db;
}

.option-input:checked + .option-text {
  color: #3498db;
  font-weight: 600;
}

.submit-container {
  text-align: center;
  margin-top: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.submit-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
  min-width: 200px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 152, 219, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.results-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.score-display {
  font-size: 3rem;
  font-weight: 700;
  margin: 20px 0;
  background: linear-gradient(135deg, #3498db, #2980b9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-details {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #f8f9fa;
}

.result-word {
  font-weight: 600;
  color: #2c3e50;
}

.result-answer {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.correct-answer {
  background: #d4edda;
  color: #155724;
}

.incorrect-answer {
  background: #f8d7da;
  color: #721c24;
}

.no-answer {
  background: #fff3cd;
  color: #856404;
}

.retry-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  border: none;
  padding: 14px 30px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46, 204, 113, 0.4);
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: #721c24;
  padding: 16px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .quiz-header {
    padding: 20px;
  }

  .quiz-header h1 {
    font-size: 2rem;
  }

  .question-card {
    padding: 20px 16px;
  }

  .question-title {
    font-size: 1.2rem;
    display: block;
    margin-top: 8px;
  }

  .question-number {
    margin-right: 0;
    margin-bottom: 8px;
  }

  .option-label {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .submit-container {
    padding: 20px;
  }

  .submit-btn {
    width: 100%;
    padding: 16px 20px;
  }

  .score-display {
    font-size: 2.5rem;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .result-answer {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .quiz-header h1 {
    font-size: 1.8rem;
  }

  .question-title {
    font-size: 1.1rem;
  }

  .question-text {
    font-size: 1rem;
  }

  .option-label {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
}