/* Estilos del Test de Camuflaje Autista (CAT-Q) - Fijate Tools */

:root {
  --bg-app: #080d1a;
  --bg-card: #12192b;
  --bg-card-secondary: #1a243a;
  --bg-card-hover: #22304d;
  --border-color: #25334e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-color: #a855f7;
  --accent-hover: #9333ea;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-secondary: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.tool-main-content {
  flex: 1;
  min-width: 0;
}

.card-main {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Barra de progreso */
.progress-box {
  margin-bottom: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-card-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), #ec4899);
  width: 0%;
  transition: width 0.25s ease;
}

/* Pregunta actual */
.question-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.question-subscale-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-color);
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

.question-statement-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

/* Opciones Likert de 7 puntos */
.catq-likert-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.catq-likert-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  cursor: pointer;
  color: var(--text-main);
  text-align: left;
  transition: all 0.15s ease;
}

.catq-likert-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-color);
  transform: translateX(3px);
}

.catq-likert-btn.selected {
  background: var(--bg-card-hover);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color);
}

.catq-likert-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent-color);
  flex-shrink: 0;
}

.catq-likert-label {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Resultados */
.results-card {
  display: none;
}

.score-box-center {
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.score-huge-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
}

.score-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.badge-high { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-neutral { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.badge-low { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }

.subscales-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.subscale-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.sub-name { font-weight: 600; font-size: 0.95rem; }
.sub-score { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent-color); }

.sub-track {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.sub-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), #ec4899);
}

.sub-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-section {
  margin: 2rem 0;
  text-align: center;
}

#catq-chart-canvas {
  width: 100%;
  max-width: 480px;
  height: 260px;
  margin: 0 auto;
  display: block;
}

.bottom-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.btn-primary {
  min-height: 42px;
  padding: 0 1.25rem;
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  min-height: 40px;
  padding: 0 1rem;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.custom-modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center; justify-content: center;
  padding: 1rem;
}

.custom-modal-card {
  width: 100%; max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

@media (max-width: 768px) {
  .card-main { padding: 1.25rem; }
  .bottom-buttons-row { flex-direction: column; }
  .bottom-buttons-row button { width: 100%; }
}

@media print {
  body { background: #ffffff !important; color: #000000 !important; }
  .app-header, .tools-ad-banner-section, .tool-ad-sidebar, .fijate-footer, .bottom-buttons-row, .question-top-bar, .custom-modal-backdrop, #question-card {
    display: none !important;
  }
  .tool-layout { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .card-main { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .results-card { display: block !important; }
  .score-box-center { background: #f8fafc !important; border: 1px solid #cbd5e1 !important; color: #000000 !important; }
  .subscale-card { background: #f8fafc !important; border: 1px solid #cbd5e1 !important; break-inside: avoid; }
}
