/**
 * Q2L - Question-Based Learning Application
 * Custom Styles
 */

/* Global Styles */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
}

/* Make footer stick to bottom */
main {
  flex: 1;
}

/* Navigation */
.navbar-brand {
  font-weight: 600;
  font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 1);
}

/* Cards */
.card {
  border-radius: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Set maximum height for dashboard cards */
.card.h-100 {
  max-height: 500px;
}

/* Make card bodies scrollable when content overflows */
.card.h-100 .card-body {
  max-height: 400px;
  overflow-y: auto;
}

/* Ensure chart containers don't grow too large */
.card .chart-container, 
.card canvas {
  max-height: 250px;
}

/* Buttons */
.btn {
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* Forms */
.form-control, .form-select {
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Scenario Cards */
.scenario-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scenario-card .card-body {
  flex: 1;
}

.scenario-card .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

.scenario-difficulty-easy {
  background-color: #d1e7dd;
  color: #0f5132;
}

.scenario-difficulty-medium {
  background-color: #fff3cd;
  color: #664d03;
}

.scenario-difficulty-hard {
  background-color: #f8d7da;
  color: #842029;
}

/* Question Evaluation Badges */
.evaluation-deep {
  background-color: #d1e7dd;
  color: #0f5132;
}

.evaluation-shallow {
  background-color: #fff3cd;
  color: #664d03;
}

.evaluation-irrelevant {
  background-color: #f8d7da;
  color: #842029;
}

/* Feedback Panels */
.feedback-panel {
  border-left: 4px solid var(--primary-color);
  background-color: #f8f9fa;
  padding: 1rem;
  margin-bottom: 1rem;
}

.feedback-panel.ai-feedback {
  border-left-color: var(--info-color);
}

.feedback-panel.teacher-feedback {
  border-left-color: var(--success-color);
}

/* Progress Bars */
.progress {
  height: 0.75rem;
  border-radius: 0.25rem;
}

/* Dashboard Stats */
.stat-card {
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-title {
  font-size: 0.875rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.2;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* Scenario Content */
.scenario-content {
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
}

/* Question Form */
.question-form {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-form textarea {
  min-height: 120px;
}

/* Interactions List */
.interaction-item {
  border-left: 4px solid var(--secondary-color);
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.interaction-item.deep {
  border-left-color: var(--success-color);
}

.interaction-item.shallow {
  border-left-color: var(--warning-color);
}

.interaction-item.irrelevant {
  border-left-color: var(--danger-color);
}

/* Analytics Charts */
.chart-container {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Help System */
.help-section {
  margin-bottom: 2rem;
}

.help-section h3 {
  margin-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  
  .stat-card .stat-icon {
    font-size: 2rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Loading Spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: var(--dark-color);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
