/* --- Variables de Diseño Tutorial (Modo Claro Premium - Legibilidad de Vanguardia) --- */
:root {
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Space Grotesk', monospace;

  /* Colores */
  --bg-light: #ffffff;
  --bg-app: #f8fafc;            /* Slate 50 */
  --bg-card: rgba(255, 255, 255, 0.95);
  --border-glass: rgba(15, 23, 42, 0.08);

  /* Acentos Temáticos */
  --primary: #6366f1;          /* Indigo */
  --primary-light: #e0e7ff;
  --primary-dark: #4338ca;
  --accent-client: #8b5cf6;    /* Violet */
  --accent-driver: #f97316;    /* Orange */
  --accent-admin: #0284c7;     /* Sky Blue */
  --color-success: #10b981;
  --color-text-main: #0f172a;  /* Slate 900 */
  --color-text-muted: #475569; /* Slate 700 */
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6.5rem 1.5rem 3rem 1.5rem; /* Margen para demo-top-bar */
  overflow-x: hidden;
}

.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 45%);
  z-index: -1;
  pointer-events: none;
}

/* --- Barra de Navegación de Demo Superior --- */
.demo-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 999999;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.demo-logo {
  font-weight: 850;
  font-size: 1.1rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.5px;
}

.demo-logo span {
  font-size: 0.7rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.demo-links {
  display: flex;
  gap: 0.75rem;
}

.demo-link-btn {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
  color: #475569;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.demo-link-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
}

.demo-link-btn.active-client {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.15);
}

.demo-link-btn.active-driver {
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.15);
}

.demo-link-btn.active-admin {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.15);
}

.demo-link-btn.active-tutorial {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.15);
}

/* --- Contenedor del Tutorial --- */
.tutorial-container {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.tutorial-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.tutorial-header h1 {
  font-size: 2.2rem;
  font-weight: 850;
  letter-spacing: -0.75px;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

.tutorial-header p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  font-weight: 600;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- Fichas de Roles --- */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .roles-grid {
    grid-template-columns: 1fr;
  }
}

.role-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.02);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.role-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.05);
}

.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
}

.role-card.client::before { background: var(--accent-client); }
.role-card.driver::before { background: var(--accent-driver); }
.role-card.admin::before { background: var(--accent-admin); }

.role-icon {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

.role-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

.role-card.client h3 { color: var(--accent-client); }
.role-card.driver h3 { color: var(--accent-driver); }
.role-card.admin h3 { color: var(--accent-admin); }

.role-card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  font-weight: 500;
}

.role-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.role-card li {
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-card.client li { color: #6d28d9; }
.role-card.driver li { color: #c2410c; }
.role-card.admin li { color: #0369a1; }

.bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* --- Panel del Presentador (Interactive Steps Guide) --- */
.guide-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 30px;
  padding: 2.5rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.guide-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 1rem;
}

.guide-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guide-title h2 {
  font-size: 1.5rem;
  font-weight: 850;
  letter-spacing: -0.5px;
}

.step-indicator {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-nav-buttons {
  display: flex;
  gap: 0.5rem;
}

.circle-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: var(--color-text-main);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.circle-nav-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.2);
}

.circle-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Contenido de Pasos */
.step-slide {
  display: none;
  animation: slideFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-direction: column;
  gap: 1.25rem;
}

.step-slide.active {
  display: flex;
}

.step-slide h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.step-description {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  font-weight: 500;
}

.step-script-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 1.1rem 1.3rem;
}

.script-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.35rem;
}

.script-content {
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.5;
}

.observational-box {
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.observational-box svg {
  width: 20px;
  height: 20px;
  color: var(--color-success);
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.observation-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-success-light);
  line-height: 1.45;
}

/* --- Animación Didáctica (Simulador Interactivo) --- */
.playground-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 30px;
  padding: 2.25rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.playground-card h2 {
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: -0.5px;
}

.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .playground-grid {
    grid-template-columns: 1fr;
  }
}

.simulator-map-box {
  background: #f1f5f9;
  border-radius: 20px;
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.interactive-map-svg {
  width: 100%;
  height: auto;
  max-height: 180px;
}

.interactive-terminal {
  background: #0f172a;
  border-radius: 20px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-mono);
  color: #38bdf8;
  font-size: 0.82rem;
  height: 200px;
  overflow-y: auto;
}

.terminal-line {
  line-height: 1.5;
  animation: fadeIn 0.25s ease-out;
}

.terminal-line.yellow { color: #f59e0b; }
.terminal-line.green { color: #10b981; }

.play-controls {
  display: flex;
  gap: 0.8rem;
}

.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 750;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
  filter: brightness(1.05);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--color-text-main);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

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

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

@media (max-width: 480px) {
  .demo-top-bar {
    padding: 0 0.75rem;
    height: 54px;
  }
  .demo-logo {
    display: none;
  }
  .demo-links {
    width: 100%;
    justify-content: space-around;
  }
  .demo-link-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
}

/* Selector de idioma en el demo bar */
.demo-lang-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-lang-lbl {
  font-size: 0.8rem;
  font-weight: 750;
  color: #475569;
}

.demo-lang-select {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 6px;
  color: #0f172a;
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 750;
  font-family: 'Outfit', sans-serif;
  outline: none;
  cursor: pointer;
  width: auto;
}

.demo-lang-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
