/* EVDO - Simulador de Competencias Socioemocionales Styles */
:root {
  --primary-color: #007bff;
  --primary-hover: #0069d9;
  --primary-active: #0056b3;
  --secondary-color: #5a6268;
  --secondary-hover: #484e53;
  --success-color: #28a745;
  --warning-color: #fd7e14;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --bg-color: #f4f6f9;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --header-bg: #f8f9fa;
  --text-main: #212529;
  --text-muted: #6c757d;
  --border-color: #ced4da;
  --border-light: #e9ecef;
  --radio-size: 20px;
  --base-font-size: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius: 6px;
  --transition: all 0.2s ease-in-out;
}

/* Dark Mode Variables */
body.dark-mode {
  --bg-color: #0d1117;
  --card-bg: #161b22;
  --sidebar-bg: #161b22;
  --header-bg: #1c2128;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --border-color: #30363d;
  --border-light: #21262d;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: var(--base-font-size);
}

/* Header Container */
.header-bar {
  background-color: var(--header-bg);
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  min-height: 60px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 270px;
}

.timer-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-box.warning {
  color: #d9534f;
  border-color: #d9534f;
  animation: pulse 1s infinite;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  padding: 8px 24px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-prev {
  background-color: var(--secondary-color);
}
.btn-prev:hover:not(:disabled) {
  background-color: var(--secondary-hover);
}
.btn-prev:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-next {
  background-color: var(--primary-color);
}
.btn-next:hover {
  background-color: var(--primary-hover);
}
.btn-finish {
  background-color: var(--success-color);
}
.btn-finish:hover {
  background-color: #218838;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.test-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.study-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.study-mode-toggle:hover {
  border-color: var(--primary-color);
}

.study-mode-toggle input {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* App Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 290px;
  min-width: 290px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.05);
}

.candidate-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-icon {
  font-size: 16px;
  color: var(--text-muted);
}

.sidebar-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.answered-counter {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
}

/* Grid Container */
.grid-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 12px;
}

.grid-scroll-area::-webkit-scrollbar {
  width: 5px;
}
.grid-scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
body.dark-mode .grid-scroll-area::-webkit-scrollbar-thumb {
  background: #334155;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.q-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  background-color: #e9ecef;
  color: #495057;
}

body.dark-mode .q-btn {
  background-color: #21262d;
  color: #c9d1d9;
}

.q-btn:hover {
  filter: brightness(0.92);
}

.q-btn.answered {
  background-color: #007bff !important;
  color: #ffffff !important;
}

.q-btn.current {
  background-color: #28a745 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.45);
  transform: scale(1.06);
  z-index: 2;
}

/* Zoom controls */
.sidebar-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.zoom-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.zoom-buttons {
  display: flex;
  gap: 8px;
}

.zoom-btn {
  flex: 1;
  padding: 6px 0;
  background-color: #0096c7;
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.zoom-btn:hover {
  background-color: #0077b6;
}

/* Main Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 26px 40px;
  display: flex;
  flex-direction: column;
}

.question-card {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.part-badge {
  background-color: rgba(0, 123, 255, 0.12);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.question-progress {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.question-statement {
  font-size: calc(var(--base-font-size) * 1.15);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 18px;
}

.dotted-separator {
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 20px;
  width: 100%;
}

/* Options scale list */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

.option-item:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

.option-radio-custom {
  width: var(--radio-size);
  height: var(--radio-size);
  border: 2px solid #0088cc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  background: var(--card-bg);
}

.option-radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.option-item.selected .option-radio-custom {
  border-color: #007bff;
}

.option-item.selected .option-radio-dot {
  background-color: #007bff;
  transform: scale(1);
}

.option-label {
  font-size: calc(var(--base-font-size) * 0.95);
  color: var(--text-main);
  font-weight: 500;
}

.option-item.selected .option-label {
  font-weight: 600;
  color: var(--primary-color);
}

/* Post-answer status highlights */
.option-item.is-optimal-choice {
  background-color: rgba(40, 167, 69, 0.1) !important;
  border-left: 4px solid var(--success-color) !important;
}

.option-item.is-user-suboptimal {
  background-color: rgba(253, 126, 20, 0.1) !important;
  border-left: 4px solid var(--warning-color) !important;
}

.optimal-pill {
  margin-left: auto;
  background-color: #28a745;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-pill {
  margin-left: auto;
  background-color: #fd7e14;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Explanation & Comparative Pedagogical Card */
.explanation-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 14px;
  box-shadow: var(--shadow-md);
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.explanation-card.active {
  display: block;
}

.explanation-card.status-optimal {
  border: 1px solid #c3e6cb;
  border-left: 6px solid #28a745;
  background-color: rgba(40, 167, 69, 0.04);
}

.explanation-card.status-suboptimal {
  border: 1px solid #ffeeba;
  border-left: 6px solid #fd7e14;
  background-color: rgba(253, 126, 20, 0.04);
}

body.dark-mode .explanation-card.status-optimal {
  border-color: #1e4620;
  background-color: #122416;
}

body.dark-mode .explanation-card.status-suboptimal {
  border-color: #5c3809;
  background-color: #2b1d0e;
}

.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feedback-badge.badge-success {
  background: #28a745;
  color: #ffffff;
}

.feedback-badge.badge-warning {
  background: #fd7e14;
  color: #ffffff;
}

.dimension-tag {
  background: rgba(0, 123, 255, 0.12);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
}

.feedback-section {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.feedback-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-text-user {
  color: var(--text-main);
  margin-bottom: 10px;
}

.feedback-text-best {
  color: var(--text-main);
  margin-bottom: 10px;
}

.explanation-tip {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}

/* Quick Actions Bottom */
.bottom-actions {
  max-width: 920px;
  margin: 20px auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quick-btn:hover {
  background: var(--border-light);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.results-modal {
  background: var(--card-bg);
  border-radius: 10px;
  width: 92%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  overflow: hidden;
  transform: scale(0.96);
  transition: var(--transition);
}

.modal-overlay.active .results-modal {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Results Summary Cards */
.results-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-color);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.summary-card .number {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.summary-card .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Competency Progress Bars */
.dimensions-section {
  margin-bottom: 24px;
}

.dimension-bar-item {
  margin-bottom: 12px;
}

.dimension-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

body.dark-mode .progress-track {
  background: #21262d;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #28a745);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Review Table */
.review-table-container {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 16px;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-table th, .review-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.review-table th {
  background: var(--header-bg);
  font-weight: 700;
}

.badge-match {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.badge-match.perfect {
  background: #d4edda;
  color: #155724;
}
.badge-match.differ {
  background: #fff3cd;
  color: #856404;
}
.badge-match.missing {
  background: #f8d7da;
  color: #721c24;
}

.modal-footer {
  padding: 14px 24px;
  background: var(--header-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar {
    width: 240px;
    min-width: 240px;
  }
  .content-area {
    padding: 20px 20px;
  }
  .header-left {
    width: auto;
  }
  .test-title {
    display: none;
  }
}
