/**
 * Fijate Tools - Recreación de Slot Machine Mecánica de los Años 60 en 3D
 * style.css
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores Corporativos Tema Oscuro */
  --bg-primary: #0b0f17;
  --bg-surface: #131b2a;
  --bg-surface-elevated: #1a2538;
  --border-subtle: #24324a;
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  --accent-cyan: #38bdf8;
  --accent-red: #ef4444;
  --accent-green: #22c55e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
}

body[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-gold: #d97706;
  --accent-gold-glow: rgba(217, 119, 6, 0.2);
  --accent-cyan: #0284c7;
  --accent-red: #dc2626;
  --accent-green: #16a34a;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.16);
}

/* Reset y Contención */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  line-height: 1.25;
}

.text-mono {
  font-family: var(--font-mono);
}

/* Layout Principal */
.tool-layout {
  max-width: 1240px;
  width: 100%;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1536px) {
  .tool-with-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

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

/* Visor 3D y Canvas */
.viewport-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 580px;
  min-height: 440px;
  background: radial-gradient(circle at center, #172133 0%, #0b0f17 100%);
  touch-action: none;
}

@media (max-width: 768px) {
  .canvas-wrapper {
    height: 420px;
  }
}

.canvas-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Barra de herramientas flotante sobre el 3D */
.viewport-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.toolbar-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.btn-tool {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 6px 14px;
  font-family: var(--font-main);
  font-size: 0.825rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-tool:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-tool.active {
  background: var(--accent-cyan);
  color: #041226;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.btn-icon-tool {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.btn-icon-tool:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
}

/* Slider de despiece explotado */
.exploded-slider-wrapper {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  box-shadow: var(--shadow-md);
  color: #e2e8f0;
  font-size: 0.85rem;
  max-width: 90%;
}

.exploded-slider-wrapper input[type="range"] {
  width: 160px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Tarjeta flotante de información técnica (Hotspot card) */
.hotspot-card {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 320px;
  max-width: calc(100% - 28px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  z-index: 15;
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.hotspot-card.visible {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hotspot-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hotspot-badge {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-close-card {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
}

.btn-close-card:hover {
  color: #ffffff;
}

.hotspot-card-title {
  font-size: 1rem;
  color: #f8fafc;
  margin: 0 0 6px 0;
}

.hotspot-card-desc {
  font-size: 0.825rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.45;
}

/* Barra inferior de hotspots accesibles */
.hotspot-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  scrollbar-width: thin;
}

.btn-hotspot-nav {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.775rem;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-hotspot-nav:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Panel de control y telemetría de la máquina */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.control-panel-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Marcadores Digitales Retro */
.meters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.meter-box {
  background: #06090e;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
}

.meter-label {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 2px;
}

.meter-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1.1;
  text-shadow: 0 0 10px var(--accent-gold-glow);
}

.meter-value.win-pulse {
  animation: winGlow 1.2s ease-out;
  color: var(--accent-green);
}

@keyframes winGlow {
  0% { transform: scale(1.15); color: #4ade80; text-shadow: 0 0 16px rgba(74, 222, 128, 0.8); }
  100% { transform: scale(1); color: var(--accent-gold); }
}

/* Botones principales de acción */
.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary-action {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1a0f00;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-primary-action:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-secondary-action {
  width: 100%;
  min-height: 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary-action:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}

/* Indicador de estado cinemático */
.status-indicator-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* Selector didáctico de velocidad y combinaciones */
.field-group {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Desplegable estilizado conforme a las normas */
.styled-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 40px 0 12px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.styled-select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.speed-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-speed-mode {
  min-height: 42px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-speed-mode.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Guía didáctica y acordeones explicativos */
.guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.guide-section h2 {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.guide-intro {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.mechanism-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.mech-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.mech-card-step {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 4px;
}

.mech-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.mech-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Acordeón de preguntas técnicas */
.faq-details {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.faq-details:last-child {
  border-bottom: none;
}

.faq-summary {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
}

.faq-details[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-content {
  padding-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
