/* Tactics Lab Styles */

.tactics-lab {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Lab Header */
.lab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.lab-title h2 {
  font-size: 2.5em;
  margin: 0 0 5px 0;
  font-weight: 700;
}

.lab-subtitle {
  font-size: 1.1em;
  opacity: 0.9;
  margin: 0;
}

.lab-stats {
  display: flex;
  gap: 30px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2em;
  font-weight: bold;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.9em;
  opacity: 0.8;
  margin-top: 5px;
}

/* Mode Selection */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.lab-mode-card {
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.lab-mode-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.lab-mode-card:active {
  transform: translateY(0);
}

.mode-icon {
  font-size: 3em;
  margin-bottom: 15px;
  display: block;
}

.lab-mode-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.4em;
  color: #2c3e50;
}

.lab-mode-card p {
  margin: 0 0 15px 0;
  color: #7f8c8d;
  line-height: 1.5;
}

.mode-stats {
  font-size: 0.9em;
  color: #667eea;
  font-weight: 500;
}

/* Challenge Screen */
.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.challenge-info h3 {
  margin: 0 0 8px 0;
  font-size: 1.5em;
  color: #2c3e50;
}

.challenge-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.difficulty-badge, .theme-badge, .points-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 500;
}

.difficulty-badge {
  background: #e8f4fd;
  color: #2980b9;
}

.theme-badge {
  background: #fef9e7;
  color: #f39c12;
}

.points-badge {
  background: #eafaf1;
  color: #27ae60;
}

.challenge-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.timer-display {
  font-size: 2em;
  font-weight: bold;
  color: #2c3e50;
  min-width: 60px;
  text-align: center;
  padding: 10px 15px;
  background: #ecf0f1;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.timer-warning {
  background: #fff3cd;
  color: #856404;
  animation: pulse 1s infinite;
}

.timer-critical {
  background: #f8d7da;
  color: #721c24;
  animation: shake 0.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Lab Buttons */
.lab-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

.lab-btn.primary {
  background: #667eea;
  color: white;
}

.lab-btn.primary:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
}

.lab-btn.secondary {
  background: #ecf0f1;
  color: #2c3e50;
}

.lab-btn.secondary:hover {
  background: #d5dbdb;
}

.lab-btn.danger {
  background: #e74c3c;
  color: white;
}

.lab-btn.danger:hover {
  background: #c0392b;
}

/* Challenge Board */
.challenge-board-container {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
}

.challenge-objective {
  flex: 1;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  font-size: 1.1em;
  line-height: 1.6;
  color: #2c3e50;
}

.lab-board {
  width: 400px;
  height: 400px;
  flex-shrink: 0;
}

/* Challenge Feedback */
.challenge-feedback {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.feedback-correct {
  color: #27ae60;
}

.feedback-incorrect {
  color: #e74c3c;
}

.feedback-icon {
  font-size: 2em;
  margin-bottom: 10px;
}

.feedback-message {
  font-size: 1.2em;
  font-weight: 500;
  margin-bottom: 8px;
}

.feedback-time {
  color: #7f8c8d;
  font-size: 0.9em;
}

.feedback-combo {
  color: #f39c12;
  font-weight: bold;
  font-size: 1.1em;
  margin-top: 8px;
}

/* Progress Bar */
.challenge-progress {
  background: white;
  border-radius: 12px;
  padding: 15px 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #ecf0f1;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.5s ease;
  border-radius: 3px;
}

.progress-text {
  text-align: center;
  color: #7f8c8d;
  font-size: 0.9em;
}

/* Results Screen */
.lab-results {
  text-align: center;
}

.results-content {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: 0 auto;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.result-stat {
  padding: 20px;
  border-radius: 12px;
  background: #f8f9fa;
}

.result-value {
  display: block;
  font-size: 2.5em;
  font-weight: bold;
  color: #667eea;
  line-height: 1;
}

.result-label {
  display: block;
  margin-top: 5px;
  color: #7f8c8d;
  font-size: 0.9em;
}

.results-achievements {
  margin: 20px 0;
  padding: 15px;
  background: #fef9e7;
  border-radius: 8px;
  color: #856404;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

/* Challenge Hint */
.challenge-hint {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 10px 15px;
  margin-top: 15px;
  color: #856404;
  font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
  .lab-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .lab-stats {
    gap: 20px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .challenge-header {
    flex-direction: column;
    gap: 15px;
  }

  .challenge-board-container {
    flex-direction: column;
  }

  .lab-board {
    width: 100%;
    height: 300px;
  }

  .challenge-controls {
    justify-content: center;
  }

  .timer-display {
    font-size: 1.5em;
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.tactics-lab > * {
  animation: fadeIn 0.5s ease-out;
}

/* Achievement badges */
.achievement {
  display: inline-block;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 500;
  margin: 5px;
}

.achievement::before {
  content: "🏆 ";
}