/* css/typing-challenge.css - Typing challenge interactive element styles */

.typing-challenge {
  margin: 40px 0;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid #e9ecef;
}

.typing-challenge h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #212529;
}

.typing-challenge .icon {
  font-size: 24px;
}

.challenge-instruction {
  margin-bottom: 20px;
  color: #6c757d;
  font-size: 14px;
}

.challenge-code-preview {
  background: #212529;
  color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  overflow-x: auto;
}

.challenge-code-preview code {
  color: #a5d6ff;
}

.challenge-input {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s ease;
  background: white;
  color: #212529;
}

.challenge-input:focus {
  outline: none;
  border-color: #f74c00;
  box-shadow: 0 0 0 3px rgba(247, 76, 0, 0.1);
}

.challenge-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.challenge-actions button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.challenge-actions .btn-primary {
  background: #f74c00;
  color: white;
}

.challenge-actions .btn-primary:hover {
  background: #e64500;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(247, 76, 0, 0.3);
}

.challenge-actions .btn-secondary {
  background: #6c757d;
  color: white;
}

.challenge-actions .btn-secondary:hover {
  background: #5a6268;
}

.challenge-feedback {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  display: none;
}

.challenge-feedback.show {
  display: block;
}

.feedback-success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.feedback-error {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.feedback-success h5,
.feedback-error h5 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

.feedback-success p,
.feedback-error p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.feedback-error details {
  margin-top: 10px;
}

.feedback-error summary {
  cursor: pointer;
  font-weight: 600;
  padding: 5px 0;
}

.feedback-error pre {
  background: #212529;
  color: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
  overflow-x: auto;
  font-size: 13px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .typing-challenge {
    padding: 20px 15px;
    margin: 30px 0;
  }

  .challenge-input {
    font-size: 13px;
    min-height: 100px;
  }

  .challenge-actions {
    flex-direction: column;
  }

  .challenge-actions button {
    width: 100%;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .typing-challenge {
    background: #2d3748;
    border-color: #4a5568;
  }

  .typing-challenge h4 {
    color: #e2e8f0;
  }

  .challenge-instruction {
    color: #a0aec0;
  }

  .challenge-input {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .challenge-input:focus {
    border-color: #f74c00;
    box-shadow: 0 0 0 3px rgba(247, 76, 0, 0.2);
  }

  .feedback-success {
    background: #1b5e20;
    color: #a5d6a7;
  }

  .feedback-error {
    background: #7f0000;
    color: #ef9a9a;
  }
}
