/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Mode Selection */
.mode-selection {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.mode-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 280px;
  max-width: 350px;
}

.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.mode-icon {
  font-size: 3rem;
  color: #667eea;
  margin-bottom: 20px;
}

.mode-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.mode-card p {
  color: #666;
  font-size: 1rem;
}

/* Back Button */
.back-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.back-btn:hover {
  background: #5a6fd8;
  transform: translateY(-2px);
}

/* Study Mode */
.study-mode,
.quiz-mode {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.study-header,
.quiz-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.study-header h2,
.quiz-header h2 {
  margin-left: 20px;
  color: #333;
  font-size: 1.8rem;
}

/* Pattern Selector */
.pattern-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.pattern-btn {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.pattern-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pattern-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* Pattern Content */
.pattern-content {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  min-height: 400px;
}

.pattern-section {
  margin-bottom: 25px;
}

.pattern-section h3 {
  color: #667eea;
  font-size: 1.3rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.pattern-section h3 i {
  margin-right: 10px;
}

.pattern-section ul {
  list-style: none;
  padding-left: 0;
}

.pattern-section li {
  background: white;
  margin-bottom: 8px;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Quiz Settings */
.quiz-settings {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
}

.start-quiz-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 20px;
}

.start-quiz-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

/* Quiz Container */
.quiz-progress {
  margin-bottom: 30px;
}

.progress-bar {
  background: #e9ecef;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  background: linear-gradient(90deg, #667eea, #764ba2);
  height: 100%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

/* Question Container */
.question-container {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  min-height: 300px;
}

.question {
  margin-bottom: 25px;
}

.question h3 {
  color: #333;
  font-size: 1.2rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.option:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.option.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.option.correct {
  border-color: #28a745;
  background: #d4edda;
  color: #155724;
}

.option.incorrect {
  border-color: #dc3545;
  background: #f8d7da;
  color: #721c24;
}

/* Quiz Controls */
.quiz-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.control-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
}

.control-btn:hover:not(:disabled) {
  background: #5a6fd8;
  transform: translateY(-2px);
}

.control-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.exit-btn {
  background: #dc3545 !important;
  margin-top: 10px;
}

.exit-btn:hover:not(:disabled) {
  background: #c82333 !important;
  transform: translateY(-2px);
}

/* Results Container */
.results-container {
  text-align: center;
}

.results-header {
  margin-bottom: 30px;
}

.results-header h3 {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 20px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.score {
  font-size: 3rem;
  font-weight: 700;
  color: #667eea;
}

.score-label {
  font-size: 1rem;
  color: #666;
  font-weight: 500;
}

.results-summary {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  text-align: left;
}

.results-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: #5a6fd8;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .mode-selection {
    flex-direction: column;
    align-items: center;
  }

  .mode-card {
    min-width: 250px;
    padding: 30px;
  }

  .pattern-selector {
    justify-content: center;
  }

  .quiz-controls {
    flex-direction: column;
  }

  .results-actions {
    flex-direction: column;
    align-items: center;
  }

  .action-btn {
    width: 200px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .study-mode,
  .quiz-mode {
    padding: 20px;
  }

  .pattern-content {
    padding: 20px;
  }

  .question-container {
    padding: 20px;
  }
}

/* Footer */
.footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
  color: white;
}

.footer p {
  margin: 5px 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.footer p:first-child {
  font-weight: 500;
}
