/* ============================================
   GUÍA INTERACTIVA DE IA - GUÍA GENERAL
   Design System & Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ── */
:root {
  /* Brand Colors */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #06b6d4;
  --secondary-light: #22d3ee;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Background */
  --bg-main: #0f0f23;
  --bg-surface: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-strong: rgba(255, 255, 255, 0.1);
  --bg-input: rgba(255, 255, 255, 0.08);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #818cf8;

  /* Borders */
  --border: rgba(255, 255, 255, 0.1);
  --border-active: rgba(99, 102, 241, 0.5);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Spacing */
  --sidebar-width: 300px;
  --header-height: 70px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Premium Glass Glow */
  --glass-glow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --liquid-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));

  /* GlassLearn 2.0 - Premium Tokens */
  --glass-bg: hsla(222, 47%, 4%, 0.4);
  --glass-blur: blur(20px);
  --glass-border: hsla(0, 0%, 100%, 0.08);
  --glass-border-bright: hsla(0, 0%, 100%, 0.15);
  --shadow-lux: 0 32px 64px -16px rgba(0, 0, 0, 0.8), 0 0 24px hsla(217, 91%, 60%, 0.05);
  --shadow-premium: inset 0 1px 1px hsla(0, 0%, 100%, 0.1);
  --anim-speed: 0.3s;
  --anim-slow: 0.6s;
  --anim-curve: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode */
[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: #ffffff;
  --bg-glass-strong: #ffffff;
  --bg-input: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-accent: #3730a3;
  --border: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── DNA Terminal & Premium UI ── */
.terminal-container {
    position: relative;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
}

.terminal-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

.terminal-glow {
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}

.scan-line-bar {
    transition: width 0.4s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

.luxury-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-lux);
    transition: var(--trans-ultra);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.luxury-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.luxury-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
}

.luxury-card:hover::after {
    opacity: 1;
}

.entity-pill {
    transition: all 0.3s ease;
}

.entity-pill:hover {
    background: rgba(var(--primary-rgb), 0.2) !important;
    transform: scale(1.05);
}

/* ── Auditor Lab Styles ── */
.audit-challenge-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.audit-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--trans-ultra);
    position: relative;
}

.audit-card:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.audit-card.selected-correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.audit-card.selected-incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.audit-feedback-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: none;
    animation: fadeIn 0.4s ease;
}

.audit-feedback-box.success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    color: #fff;
    display: block;
}

.audit-feedback-box.error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: #fff;
    display: block;
}

/* ── Module 4 v3.0 Master Components ── */
.blueprint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.blueprint-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    transition: var(--trans-ultra);
    cursor: pointer;
}

.blueprint-card:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary-light);
    transform: translateY(-5px);
}

.comparison-engine {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.engine-column {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
}

.engine-title {
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--primary-light);
    display: flex;
    justify-content: space-between;
}

/* Classifier Game */
.classifier-game {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 16px;
    margin-top: 20px;
}

.classifier-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.drag-item {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    cursor: grab;
    font-size: 0.85rem;
}

.drop-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-height: 100px;
    transition: var(--trans-ultra);
}

.drop-zone.hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.premium-textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.premium-textarea:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3) !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background animated gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 15s ease-in-out infinite alternate;
}

[data-theme="light"] body::before {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.02) 0%, transparent 50%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}

@keyframes bgPulse {
  0% {
    opacity: 0.85;
  }

  100% {
    opacity: 0.95;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-glow);
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}


.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Progress bar in header */
.global-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass);
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.global-progress-bar {
  width: 120px;
  height: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.global-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 10px;
  transition: width var(--transition-slow);
  width: 0%;
}

.global-progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
}

/* Theme toggle */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-active);
  transform: rotate(20deg);
}

/* Menu toggle (mobile) */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  padding: 20px 0;
  transition: transform var(--transition-normal);
}

.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 24px 8px;
}

/* Search Bar in Sidebar */
.nav-search {
  padding: 0 16px 16px;
  position: relative;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px 10px 36px;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--bg-glass-strong);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Sidebar Navigation Grouping */
.nav-group {
  margin-bottom: 20px;
}

.nav-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 16px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-group-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--border), transparent);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  /* Kept from original */
  padding: 10px 16px;
  /* Updated */
  margin: 2px 12px;
  /* New */
  border-radius: 10px;
  /* New */
  color: var(--text-light);
  /* Updated */
  text-decoration: none;
  font-size: 0.9rem;
  /* New */
  cursor: pointer;
  transition: all 0.2s ease;
  /* Updated */
  border: 1px solid transparent;
  /* New */
  position: relative;
  /* border-left: 3px solid transparent; -- Removed as per new border property */
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.status-icon {
  margin-left: auto;
  font-size: 0.8rem;
}

.status-icon.lock {
  opacity: 0.7;
}

.status-icon.check {
  color: #4ade80;
}

.nav-item.locked:hover {
  background: transparent;
  transform: none;
}

.nav-item.active {
  background: var(--bg-card-hover);
  border-left-color: var(--primary);
  color: var(--primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
}

.nav-item:active {
  transform: scale(0.97);
}

.nav-item.completed .nav-icon {
  background: var(--success);
  color: #fff;
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.nav-label {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-glass-strong);
  color: var(--text-muted);
}

.nav-item.active .nav-badge {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 40px;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--header-height));
}

/* ── Module Container ── */
.module {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeInUp 0.5s ease;
}

.module.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Module Header ── */
.module-header {
  margin-bottom: 40px;
  position: relative;
}

.module-number {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.module-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 12px;
}

[data-theme="light"] .module-title {
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
}

.module-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 700px;
}

.module-meta {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.module-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-glass);
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

/* ── Section Cards ── */
.section-card {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.section-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.section-card:hover::before {
  opacity: 1;
}

.section-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-card h3 .icon {
  font-size: 1.4rem;
}

.section-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

.section-card p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.section-card ul,
.section-card ol {
  color: var(--text-secondary);
  padding-left: 20px;
  margin-bottom: 14px;
}

.section-card li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.section-card li::marker {
  color: var(--primary-light);
}

/* ── Info Boxes ── */
.info-box {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border-left: 4px solid;
  position: relative;
}

.info-box.tip {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--success);
}

.info-box.tip .info-title {
  color: var(--success);
}

.info-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--warning);
}

.info-box.warning .info-title {
  color: var(--warning);
}

.info-box.important {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
}

.info-box.important .info-title {
  color: var(--primary-light);
}

.info-box.example {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--secondary);
}

.info-box.example .info-title {
  color: var(--secondary);
}

.info-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ── Prompt Blocks ── */
.prompt-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 16px 0;
  overflow: hidden;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-glass-strong);
  border-bottom: 1px solid var(--border);
}

.prompt-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.prompt-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.prompt-copy:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.prompt-copy.copied {
  border-color: var(--success);
  color: var(--success);
}

.prompt-content {
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  font-family: 'Inter', sans-serif;
}

/* ── Step-by-step Guide ── */
.steps-container {
  counter-reset: step-counter;
  margin: 20px 0;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  position: relative;
}

.step::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 42px;
  width: 2px;
  height: calc(100% - 18px);
  background: linear-gradient(180deg, var(--primary), transparent);
}

.step-content {
  flex: 1;
  padding-top: 6px;
}

.step-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ── Quiz Component ── */
.quiz-container {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-icon {
  font-size: 1.5rem;
}

.quiz-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quiz-question {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 500;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option {
  padding: 14px 18px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.92rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.06);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.quiz-option.incorrect {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.quiz-option-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.quiz-option.selected .quiz-option-marker {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.quiz-option.correct .quiz-option-marker {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.quiz-option.incorrect .quiz-option-marker {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.quiz-feedback {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: none;
  animation: fadeInUp 0.3s ease;
}

.quiz-feedback.show {
  display: block;
}

.quiz-feedback.correct {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.quiz-feedback.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.quiz-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.quiz-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.quiz-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Exercise Box ── */
.exercise-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.exercise-icon {
  font-size: 1.4rem;
}

.exercise-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-light);
}

.exercise-box p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.exercise-box textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin-top: 12px;
  transition: var(--transition-fast);
  line-height: 1.6;
}

.exercise-box textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── Accordion ── */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 16px 0;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-glass);
  cursor: pointer;
  transition: var(--transition-fast);
  -webkit-user-select: none;
  user-select: none;
}

.accordion-header:hover {
  background: var(--bg-glass-strong);
}

.accordion-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-arrow {
  transition: transform var(--transition-fast);
  color: var(--text-muted);
}

.accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.accordion.open .accordion-body {
  max-height: 2000px;
}

.accordion-content {
  padding: 20px;
  border-top: 1px solid var(--border);
}

/* ── Tool Card ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.tool-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition-normal);
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tool-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.tool-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tool-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.tool-card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

.tool-card-badge.free {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.tool-card-badge.paid {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}

/* ── Comparison Table ── */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
  font-size: 0.88rem;
}

.comparison-table th {
  background: var(--bg-glass-strong);
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background: var(--bg-card-hover);
}

/* ── Navigation Buttons ── */
.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

/* ── Unified GlassLearn Button System ── */
.gl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s var(--anim-curve);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.gl-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.gl-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-active);
  background: var(--bg-glass-strong);
}

.gl-btn:hover::before {
  width: 300%;
  height: 300%;
}

.gl-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Variants */
.gl-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.gl-btn-primary:hover {
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.gl-btn-secondary {
  background: hsla(222, 47%, 15%, 0.4);
  backdrop-filter: blur(10px);
  border-color: hsla(0, 0%, 100%, 0.1);
}

.gl-btn-outline {
  background: transparent;
  border: 2px dashed var(--border);
  color: var(--text-secondary);
}

.gl-btn-outline:hover {
  border-style: solid;
  border-color: var(--success);
  color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.gl-btn-completed {
  border-style: solid;
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  cursor: default;
  pointer-events: none;
}

.gl-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.gl-btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.gl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.gl-btn-neon {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  border: none;
  color: white;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.gl-btn-neon:hover {
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
  transform: translateY(-3px) scale(1.05);
}

/* Scroll-top fix */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.scroll-top-btn.visible {
  display: flex;
}

.scroll-top-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

/* ── Welcome / Hero Section ── */
.hero-section {
  text-align: center;
  padding: 60px 20px;
  max-width: 700px;
  margin: 0 auto;
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-light);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-glow);
}

.hero-start-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

/* ── Tabs Component ── */
.tabs {
  margin: 20px 0;
}

.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.tab-panel, .ag-content {
  display: none;
  animation: fadeInUp 0.3s ease;
}

.tab-panel.active, .ag-content.active {
  display: block;
}

/* ── Search ── */
.search-container {
  position: relative;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 24px;
  }

  .menu-toggle {
    display: flex;
  }

  .global-progress {
    display: none;
  }
}

@media (max-width: 640px) {
  .module-title {
    font-size: 1.6rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-stats {
    gap: 20px;
  }

  .module-nav {
    flex-direction: column;
  }

  .nav-btn {
    width: 100%;
    justify-content: center;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: 20px;
  }

  .header-title {
    font-size: 0.9rem;
  }

  .header-subtitle {
    display: none;
  }
}

/* ── Overlay for mobile sidebar ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 850;
}

.sidebar-overlay.show {
  display: block;
}

/* ── Utility ── */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

strong {
  color: var(--text-primary);
}

/* Animate elements on scroll */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══ GAMIFICATION & ADVANCED COMPONENTS ═══ */

/* XP Dashboard in Sidebar */
.xp-dashboard {
  padding: 16px;
  margin: 0 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.xp-level-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.level-basic {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.level-inter {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.level-adv {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.level-exp {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.xp-bar-container {
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.user-meta-input {
  margin: 12px 0;
}

#userNameProfile {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

#userNameProfile:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
}

.xp-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

/* Prompt Sandbox */
.sandbox-card {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin: 24px 0;
}

.sandbox-header {
  margin-bottom: 20px;
}

.sandbox-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.sandbox-input-area,
.sandbox-output-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sandbox-textarea {
  width: 100%;
  min-height: 150px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  transition: var(--transition-fast);
}

.sandbox-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.sandbox-result {
  width: 100%;
  min-height: 150px;
  background: rgba(99, 102, 241, 0.05);
  border: 2px dashed rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  overflow-y: auto;
  font-style: italic;
  line-height: 1.6;
}

.sandbox-controls {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Certificate Premium Glassmorphism */
.certificate-container {
  padding: 60px 20px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 40%),
    radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.1), transparent 40%);
  border-radius: 40px;
  text-align: center;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.certificate-preview {
  position: relative;
  width: 100%;
  max-width: 850px;
  margin: 0 auto 40px;
  aspect-ratio: 1.414 / 1;
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  border: 2px solid rgba(255, 215, 0, 0.3);
  /* Gold border */
  border-radius: 20px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4),
    inset 0 0 40px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: #fff;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.certificate-preview:hover {
  transform: scale(1.02);
  border-color: rgba(255, 215, 0, 0.6);
}

.certificate-preview::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  pointer-events: none;
}

.cert-stamp {
  position: absolute;
  bottom: 40px;
  right: 60px;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, gold, #ffab00);
  border-radius: 50%;
  border: 4px double white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #1e1b4b;
  text-transform: uppercase;
  transform: rotate(-15deg);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  line-height: 1;
}

.cert-logo {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 2px;
}

.cert-title {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: 'Outfit', sans-serif;
}

.cert-subtitle {
  font-size: 1.2rem;
  margin: 15px 0 40px;
  color: var(--text-muted);
  letter-spacing: 4px;
}

.cert-recipient {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 2px solid rgba(255, 215, 0, 0.5);
  padding: 0 40px 10px;
  margin-bottom: 20px;
  font-family: 'Outfit', sans-serif;
}

.cert-text {
  max-width: 600px;
  line-height: 1.6;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
}

.cert-date {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ── Polishing Helper Classes ── */
.cert-header {
  text-align: center;
}

.cert-download-btn {
  margin: 0 auto;
  display: block;
}

/* Level Up Animation */
@keyframes levelUpPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.1);
    filter: brightness(1.3);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.level-up-anim {
  animation: levelUpPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Estilos para enlaces de herramientas */
.tool-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.2s;
}

.tool-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

strong>.tool-link {
  color: var(--primary);
}

.inline-tool-link {
  color: var(--primary-light);
  font-weight: 500;
}

.inline-tool-link:hover {
  color: var(--primary);
}

/* ── Confetti Celebration ── */
.confetti-particle {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  color: rgba(255, 221, 160, 0.5);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.16);
  filter: blur(0.2px);
  will-change: transform, opacity;
  animation: confettiDrift 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes confettiDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.92);
    opacity: 0;
  }

  100% {
    transform: translate3d(var(--confetti-x, 0), var(--confetti-y, -160px), 0) scale(1);
    opacity: 0;
  }
}

/* ── Tool Grid & Cards (Module 20 & Others) ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.tool-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tool-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.tool-card:hover::after {
  opacity: 1;
}

.tool-card-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.tool-card-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.tool-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tool-card-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: auto;
}

.tool-card-badge.pro {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.tool-card-badge.free {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── Hero Section Enhanced ── */
.hero {
  padding: 80px 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--liquid-gradient);
  animation: liquidRotate 60s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes liquidRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.hero>* {
  position: relative;
  z-index: 1;
}

/* ── Progress Bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 1001;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px var(--primary-light);
}

/* Visual Automation Flowchart (Module 20) */
.flowchart {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  margin: 30px 0;
  position: relative;
  overflow-x: auto;
  gap: 20px;
}

.flow-step {
  padding: 15px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 120px;
  position: relative;
  z-index: 2;
  transition: var(--transition-fast);
}

.flow-step:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.flow-arrow {
  flex-grow: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  position: relative;
  min-width: 40px;
}

.flow-line-arrow::after {
  content: '▶';
  position: absolute;
  right: -5px;
  top: -9px;
  color: var(--secondary);
  font-size: 14px;
}


/* ── Floating Action Button (Scroll to Top) ── */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1000;
  transition: all var(--transition-normal);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-5px) scale(1.1);
}

/* ── Improved Tabs System ── */
.tabs {
  margin: 20px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  gap: 8px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
  padding: 24px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Interactive Workflow Step ── */
.interactive-workflow {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.interactive-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.interactive-step:hover,
.interactive-step.active {
  transform: translateX(10px);
  border-color: var(--primary);
  background: var(--bg-glass-strong);
  box-shadow: var(--shadow-glow);
}

.step-num {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.95rem;
}

/* ── Vertical Flow Chart ── */
.flow-chart-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.flow-node {
  padding: 12px 24px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 500;
  text-align: center;
  width: 100%;
  max-width: 300px;
}

.flow-arrow {
  color: var(--primary);
  font-size: 20px;
  font-weight: bold;
}

/* ── Before vs After Comparison ── */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.compare-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.compare-card.manual {
  background: rgba(239, 68, 68, 0.05);
  /* Red tint */
  border-color: rgba(239, 68, 68, 0.2);
}

.compare-card.ai {
  background: rgba(16, 185, 129, 0.05);
  /* Green tint */
  border-color: rgba(16, 185, 129, 0.2);
}

.compare-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.manual .compare-tag {
  background: #ef4444 !important;
  color: white !important;
}

.ai .compare-tag {
  background: #10b981 !important;
  color: white !important;
}

/* ── Tool Recommender ── */
.tool-recommender {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.recommender-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-btn {
  padding: 12px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.rec-btn:hover {
  background: var(--bg-glass-strong);
  border-color: var(--primary);
  transform: translateX(5px);
}

/* ── Automation Recipe ── */
.recipe-card {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 0;
  border-left: 4px solid var(--primary);
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.recipe-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: 20px;
}

.recipe-steps {
  list-style: none;
  padding: 0;
}

.recipe-step-item {
  display: flex;
  gap: 15px;
  margin-bottom: 16px;
}

.recipe-step-circle {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

/* ── Troubleshoot Box ── */
.troubleshoot-box {
  background: rgba(255, 171, 0, 0.05);
  border: 1px dashed #ffab00;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 30px;
}

.troubleshoot-title {
  color: #ffab00;
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Print Styles (Certificate) ── */
@media print {
  body * {
    visibility: hidden;
  }

  #certificate,
  #certificateContent,
  #certificateContent * {
    visibility: visible;
  }

  .certificate-preview {
    position: fixed;
    left: 0;
    top: 0;
    width: 297mm;
    height: 210mm;
    margin: 0;
    border: 15px solid #6366f1 !important;
    background: white !important;
    color: #1e293b !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }

  .cert-logo,
  .cert-recipient,
  .cert-title,
  .cert-text {
    color: #1e1b4b !important;
  }

  .cert-stamp {
    background: gold !important;
    color: #1e1b4b !important;
  }
}

/* ── GlassLearn 2.0 Premium Classes ── */
.glass-panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: all var(--anim-speed) var(--anim-curve);
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsla(0, 0%, 100%, 0.03), transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.glass-card-premium {
  background: linear-gradient(135deg, hsla(222, 47%, 8%, 0.7) 0%, hsla(222, 47%, 4%, 0.7) 100%);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  border: 1px solid hsla(0, 0%, 100%, 0.05);
  border-top: 1px solid hsla(0, 0%, 100%, 0.12);
  border-left: 1px solid hsla(0, 0%, 100%, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lux);
  position: relative;
  transition: all var(--anim-speed) var(--anim-curve);
}

.glass-card-premium:hover {
  border-color: hsla(190, 100%, 50%, 0.3);
  box-shadow: var(--shadow-glow), var(--shadow-premium);
}

.card-premium-small {
  background: linear-gradient(135deg, hsla(222, 47%, 12%, 0.5) 0%, hsla(222, 47%, 6%, 0.7) 100%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid hsla(0, 0%, 100%, 0.06);
  border-top: 1px solid hsla(190, 100%, 50%, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--anim-speed) var(--anim-curve);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.card-premium-small::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, hsla(190, 100%, 50%, 0.05), transparent 70%);
  pointer-events: none;
}

.card-premium-small:hover {
  transform: translateY(-5px);
  border-color: hsla(190, 100%, 50%, 0.25);
  box-shadow: var(--shadow-md), 0 0 15px hsla(190, 100%, 50%, 0.05);
}

.glow-border {
  position: relative;
}

.glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, hsla(190, 100%, 50%, 0.1), transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  transition: opacity var(--anim-speed);
}

.glow-border:hover::after {
  opacity: 1;
  background: linear-gradient(135deg, hsl(190, 100%, 50%) 0%, hsl(210, 100%, 50%) 100%);
}

/* =========================================
   AGENT GAMIFICATION UI
   ========================================= */

.agent-terminal-overlay {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.terminal-notification {
  background: rgba(10, 15, 20, 0.95);
  border-left: 3px solid #0f0;
  color: #0f0;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  padding: 1rem;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out forwards;
}

.notif-success { border-color: #0f0; color: #0f0; text-shadow: 0 0 5px rgba(0,255,0,0.5); }
.notif-warning { border-color: #ffaa00; color: #ffaa00; text-shadow: 0 0 5px rgba(255, 170, 0, 0.5); }
.notif-danger { border-color: #ff3333; color: #ff3333; text-shadow: 0 0 5px rgba(255, 51, 51, 0.5); }

.prompt-symbol { margin-right: 8px; font-weight: bold; }
.typing-text { border-right: 2px solid transparent; animation: blinkCur 1s infinite; }

@keyframes blinkCur { 50% { border-color: currentColor; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.fade-out { animation: fadeOut 0.5s ease-out forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* Oracle Challenge specific styles */
.oracle-container {
  background: rgba(0, 20, 10, 0.6);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 8px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.oracle-header { text-align: center; margin-bottom: 2rem; }
.neon-text {
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
}
.oracle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .oracle-grid { grid-template-columns: 1fr; } }
.oracle-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 0, 0.1);
  padding: 1.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}
.oracle-card:hover { border-color: rgba(0, 255, 0, 0.4); box-shadow: 0 0 15px rgba(0, 255, 0, 0.1); }
.oracle-card h3 { color: #00ffcc; margin-top: 0; font-family: 'Inter', sans-serif;}
.oracle-radio {
  display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 1rem; cursor: pointer;
  padding: 0.5rem; border-radius: 4px; transition: background 0.2s;
}
.oracle-radio:hover { background: rgba(0, 255, 0, 0.05); }
.oracle-input-container textarea {
  width: 100%; min-height: 80px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(0, 255, 0, 0.3);
  color: #0f0; padding: 1rem; border-radius: 4px; font-family: 'Courier New', monospace; resize: vertical; margin-bottom: 1rem;
}
.oracle-input-container textarea:focus { outline: none; border-color: #0f0; box-shadow: 0 0 10px rgba(0, 255, 0, 0.2); }
.success-text { color: #0f0; font-weight: bold; text-shadow: 0 0 5px rgba(0,255,0,0.5); display: block; margin-top: 1rem; }
.error-text { color: #ff3333; font-weight: bold; text-shadow: 0 0 5px rgba(255,51,51,0.5); display: block; margin-top: 1rem; }
.verify-btn, .verify-btn-text {
  width: 100%; border: 1px solid #0f0; background: transparent; color: #0f0; padding: 0.5rem; border-radius: 4px;
  cursor: pointer; transition: all 0.2s; font-family: 'JetBrains Mono', monospace; font-weight: bold;
}
.verify-btn:hover, .verify-btn-text:hover { background: rgba(0, 255, 0, 0.2); box-shadow: 0 0 10px rgba(0, 255, 0, 0.4); }
.verify-btn:disabled, .verify-btn-text:disabled { opacity: 0.5; cursor: not-allowed; border-color: rgba(0, 255, 0, 0.3); color: rgba(0, 255, 0, 0.3); background: transparent; box-shadow: none; }

.oracle-actions { margin-top: 2rem; text-align: center; }
.neon-button {
  background: transparent; color: #00ffcc; border: 2px solid #00ffcc; padding: 1rem 2rem; font-size: 1.2rem;
  border-radius: 30px; cursor: pointer; transition: all 0.3s; font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
}
.neon-button:hover:not(:disabled) { background: rgba(0, 255, 204, 0.1); box-shadow: 0 0 20px rgba(0, 255, 204, 0.4); transform: scale(1.05); }
.neon-button:disabled { opacity: 0.3; cursor: not-allowed; border-color: #555; color: #555; }

/* Certificate */
.terminal-cert {
  background: #0a0e14; border: 2px solid #0f0; border-radius: 12px; padding: 3rem; text-align: center;
  position: relative; overflow: hidden; box-shadow: 0 0 40px rgba(0,255,0,0.15); max-width: 800px; margin: 0 auto;
}
.terminal-cert::after {
  content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,0,0.03) 2px, rgba(0,255,0,0.03) 4px);
  pointer-events: none;
}
.cert-stamp-neon {
  position: absolute; top: 2rem; right: 2rem; font-family: 'JetBrains Mono', monospace; font-size: 1.5rem;
  color: #0f0; border: 2px solid #0f0; padding: 0.5rem 1rem; transform: rotate(15deg); font-weight: bold;
  opacity: 0.8; box-shadow: 0 0 10px #0f0, inset 0 0 10px #0f0; border-radius: 4px; text-shadow: 0 0 5px #0f0;
}
.hacker-sub { color: #888; font-family: 'Courier New', monospace; font-size: 1.2rem; margin-bottom: 2rem; }
.radar-container { display: flex; justify-content: center; margin: 2rem 0; filter: drop-shadow(0 0 10px rgba(0,255,0,0.2)); }
.cert-stats-terminal { margin-top: 2rem; font-family: 'Courier New', monospace; color: #aaa; text-align: left; background: rgba(0,0,0,0.5); padding: 1.5rem; border-radius: 8px; border-left: 4px solid #0f0; }

/* =========================================
   LEVEL UP: CRT & GLITCH EFFECTS
   ========================================= */

/* CRT Scanline Overlay applied to specific modules or the whole app */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 2;
  opacity: 0.15;
  pointer-events: none;
}

[data-theme="light"] .scanlines {
  opacity: 0.05;
}

/* Glitch Animation for Neon Text */
.glitch-text {
  position: relative;
  color: #0f0;
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -1px 0 red;
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -1px 0 blue;
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% { clip: rect(79px, 9999px, 86px, 0); }
  20% { clip: rect(29px, 9999px, 16px, 0); }
  40% { clip: rect(69px, 9999px, 34px, 0); }
  60% { clip: rect(10px, 9999px, 59px, 0); }
  80% { clip: rect(51px, 9999px, 92px, 0); }
  100% { clip: rect(81px, 9999px, 2px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(29px, 9999px, 16px, 0); }
  20% { clip: rect(76px, 9999px, 34px, 0); }
  40% { clip: rect(59px, 9999px, 92px, 0); }
  60% { clip: rect(31px, 9999px, 2px, 0); }
  80% { clip: rect(11px, 9999px, 85px, 0); }
  100% { clip: rect(91px, 9999px, 45px, 0); }
}

/* Secret Terminal UI */
.secret-terminal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 600px;
  max-width: 90vw;
  background: rgba(5, 5, 5, 0.95);
  border: 1px solid #0f0;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2), inset 0 0 10px #0f0;
  border-radius: 8px;
  z-index: 10000;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.secret-terminal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.secret-terminal-header {
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  color: #0f0;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-history {
  height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  color: #0f0;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.terminal-input-wrapper {
  display: flex;
  color: #0f0;
  font-family: 'Courier New', monospace;
}

.terminal-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: #0f0;
  font-family: 'Courier New', monospace;
  outline: none;
  font-size: 1rem;
}

/* Hide scrollbar for terminal */
.terminal-history::-webkit-scrollbar { width: 5px; }
.terminal-history::-webkit-scrollbar-thumb { background: rgba(0, 255, 0, 0.3); }

/* ── Medals & Badges ── */
.medal-badge {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-active);
  padding: 4px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Mini-Games Styles ── */
.game-card {
  background: var(--bg-glass-strong);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.game-header {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.bad-prompt-bubble {
  background: rgba(239, 68, 68, 0.1);
  padding: 15px;
  border-radius: 12px;
  font-style: italic;
  margin: 10px 0;
  border-left: 4px solid var(--danger);
}

#battle-input {
  width: 100%;
  height: 80px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  margin-top: 10px;
  font-family: inherit;
}

.bonus-item-card:hover {
  background: var(--bg-glass-strong) !important;
  border-color: var(--primary-light) !important;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.detective-options {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.detective-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.detective-btn:hover {
  background: var(--bg-glass-strong);
  border-color: var(--primary);
}

.game-feedback {
  margin-top: 15px;
  font-weight: 600;
  font-size: 0.9rem;
}
/* ── Special Medals Animations ── */
@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    transform: scale(1);
  }
}

.special-medal {
    cursor: help;
    transition: transform 0.2s ease;
}

.special-medal:hover {
    transform: scale(1.2) rotate(5deg);
    z-index: 10;
}

/* ───── MASTER UI & UX UPGRADE - PREMIUM TOKENS & ANIMATIONS ───── */

:root {
  --primary-institucional: #f59e0b;
  --primary-empresarial: #10b981;
  --accent-cyan: #06b6d4;
  --glass-luxury: rgba(255, 255, 255, 0.08);
  --glass-border-luxury: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] {
  --primary-institucional: #92400e; 
  --primary-empresarial: #065f46;
  --accent-cyan: #0891b2;
}

/* ── Dynamic Accent Control ── */
.theme-institucional { --primary: var(--primary-institucional); --primary-light: #d97706; --primary-dark: #92400e; }
.theme-empresarial { --primary: var(--primary-empresarial); --primary-light: #059669; --primary-dark: #065f46; }

/* ── Holographic Glare Effect ── */
.holographic-glare {
  position: relative;
  overflow: hidden;
}

.holographic-glare::after {
  content: '';
  position: absolute;
  top: -150%;
  left: -150%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(-45deg);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.holographic-glare:hover::after {
  top: 100%;
  left: 100%;
}

/* ── Profession Decoder Modal ── */
.profession-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(8, 10, 20); /* Solid background for focus */
  z-index: 100000; /* Extremely high to cover everything */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.profession-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.decoder-container {
  max-width: 1000px;
  width: 90%;
  padding: 40px;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profession-modal.show .decoder-container {
  transform: translateY(0);
}

.decoder-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.decoder-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 1rem;
}

.profession-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3.5rem 2.5rem;
  border-radius: 30px;
  cursor: pointer;
  width: 380px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-align: center;
  backdrop-filter: blur(10px);
}

.profession-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, var(--card-accent), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.profession-card:hover {
  transform: translateY(-15px);
  border-color: var(--card-accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-icon {
  font-size: 4.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

.card-name {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}

.card-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Premium Certificate Upgrades ── */
.certificate-preview {
  background: #fff;
  color: #1a1a1a;
  padding: 4rem;
  border: 15px double #c5a059;
  position: relative;
  overflow: hidden;
}

.cert-premium-seal {
  position: absolute;
  bottom: 40px;
  right: 40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(#d4af37, #b8860b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  text-align: center;
  transform: rotate(-15deg);
  border: 4px solid rgba(255,255,255,0.3);
}

.cert-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 8rem;
  opacity: 0.03;
  pointer-events: none;
  font-weight: 900;
  white-space: nowrap;
}

/* ── Premium Transitions ── */
.module {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.module.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   MÓDULO 5 - IA PARA DATOS (ESTILOS EXTRA)
   ============================================ */
.module-header.game-style {
    position: relative;
    overflow: hidden;
}

.gamer-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-gradient);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: white;
}

.storytelling {
    border-left: 4px solid var(--secondary);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.05) 0%, transparent 100%);
}

.narrative-text {
    font-size: 1.1rem;
    line-height: 1.6;
    font-style: italic;
    color: var(--text-primary);
}

.data-flow-container .flow-step {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 250px;
    cursor: default;
}

.data-flow-container .flow-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.pista-ia {
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--primary);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
}

.mission-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s ease;
}

.mission-card:focus-within {
    border-color: var(--primary);
}

.game-tabs .tab-btn {
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
}

.game-tabs .tab-btn.active {
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* ── Módulo 5: Estilos de Niveles y Progreso ── */
.m5-tab {
    flex: 1;
    min-width: 120px;
    padding: 1rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: var(--transition-normal);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.m5-tab small {
    font-size: 0.7rem;
    opacity: 0.7;
}

.m5-tab.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.m5-tab.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.m5-tab.unlocked:not(.active):hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-light);
}

.m5-level-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.m5-level-content.active {
    display: block;
}

#m5-progress-fill {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ADN Power Automate Refinements */
.level-header-premium {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.level-header-premium .icon-badge {
    background: var(--primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.case-study-card {
    background: var(--bg-glass-strong);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.5rem 0;
}

/* ── Premium GlassLearn 2.0 Utilities ── */
.premium-header {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  margin-bottom: 3.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lux);
}

.premium-header::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, hsla(217, 91%, 60%, 0.1) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.glow-text {
  text-shadow: 0 0 20px hsla(217, 91%, 60%, 0.4);
}

.gamer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  animation: pulse 2s infinite;
}

.glass-card {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s var(--anim-curve);
}

.glass-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.success-text { color: var(--success); font-weight: 700; }
.error-text { color: var(--danger); font-weight: 700; }
.warning-text { color: var(--warning); font-weight: 700; }


/* ═══ SECRET TERMINAL (v23.0) ═══ */
.secret-terminal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 500px;
    height: 350px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    animation: terminalFadeIn 0.3s ease-out;
}

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

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: bold;
    border-bottom: 1px solid var(--border);
}

.terminal-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.terminal-output {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.4;
}

.terminal-line { margin-bottom: 5px; }
.line-info { color: var(--text-secondary); }
.line-user { color: var(--accent); font-weight: bold; }
.line-success { color: #00ff99; }
.line-error { color: #ff3366; }
.line-wait { color: #ffcc00; font-style: italic; }

.terminal-input-row {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--border);
}

.terminal-input-row span { color: var(--accent); }

#terminal-input {
    background: none;
    border: none;
    color: var(--text-main);
    flex: 1;
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
}
