:root {
  --primary: #0f4c75;
  --secondary: #3282b8;
  --bg-color: #f8f9fa;
  --text-color: #333;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.view {
  display: none;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}
.view.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botones y Badges */
button {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  transition: 0.3s;
}
button:hover {
  opacity: 0.9;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-secondary {
  background: #6c757d;
  color: white;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.hidden {
  display: none !important;
}
.badge {
  background: var(--warning);
  color: #000;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

/* Formularios y Login */
.login-box,
.profile-box,
.setup-box {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin: 5vh auto;
  max-width: 500px;
  text-align: center;
}
input,
select {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
}
.error-msg {
  color: var(--danger);
  margin-top: 10px;
  font-weight: bold;
  font-size: 14px;
}

/* Dashboard & Cards */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 15px;
  margin-bottom: 25px;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.card {
  background: white;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  border-top: 4px solid var(--secondary);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}
.card i {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 15px;
}

/* Historial Table */
.history-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.table-responsive {
  overflow-x: auto;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
.history-table th,
.history-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
}
.history-table th {
  background: var(--primary);
  color: white;
  font-weight: bold;
}
.history-table tr:hover {
  background: #f9f9f9;
}

/* Quiz */
.quiz-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 1.2em;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.option-btn {
  padding: 15px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s;
}
.option-btn:hover {
  border-color: var(--secondary);
}
.option-btn.selected {
  background: #e3f2fd;
  border-color: var(--primary);
  font-weight: bold;
}
.quiz-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

/* Resultados y Feedback */
.score-board {
  text-align: center;
  margin-bottom: 30px;
}
.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: white;
  border: 8px solid var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.score-circle h1 {
  margin: 0;
  font-size: 3.5em;
  color: var(--primary);
}
.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  font-size: 1.3em;
  font-weight: bold;
}
.aciertos {
  color: var(--success);
}
.errores {
  color: var(--danger);
}
.feedback-item {
  background: white;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 6px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.feedback-item.correct {
  border-left-color: var(--success);
}
.feedback-item.incorrect {
  border-left-color: var(--danger);
}
.sustento {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-left: 4px solid var(--secondary);
  font-style: italic;
  font-size: 0.95em;
}

/* Texto Referencial en Entrenamiento */
.reference-text {
  font-size: 0.75em;
  color: var(--secondary);
  margin-top: 5px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
