/* 
   ╔══════════════════════════════════════════════════════════╗
   ║  JAVA POO LEARNING - MAIN STYLES                         ║
   ║  Estilos principales con soporte Tailwind               ║
   ╚══════════════════════════════════════════════════════════╝ 
*/

/* ==================== VARIABLES ==================== */
:root {
    /* Colores principales */
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    
    /* Colores plateados para code-block */
    --silver-light: #f3f4f6;
    --silver-mid: #d1d5db;
    --silver-dark: #9ca3af;
    
    /* Syntax highlighting (plateado) */
    --syntax-keyword: #4c1d95;
    --syntax-class: #1e40af;
    --syntax-function: #b45309;
    --syntax-string: #047857;
    --syntax-comment: #374151;
    
    /* Sombras */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ── Botones de modo Aprender / Laboratorio (header) ── */
.mode-btn-active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
    transform: scale(1.05) !important;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4) !important;
    border-color: transparent !important;
}
.mode-btn-inactive {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transform: scale(1) !important;
    box-shadow: none !important;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

p {
    color: #475569;
    margin-bottom: 1rem;
}

a {
    color: #0284c7;
    text-decoration: none;
}

a:hover {
    color: #0369a1;
}

/* ==================== CODE BLOCKS ==================== */
.code-block {
    background: linear-gradient(145deg, #e8e8e8 0%, #c0c0c0 100%);
    border: 1px solid #a0a0a0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    overflow-y: visible;
    line-height: 1.6;
    font-size: 0;
    font-family: 'Fira Code', 'Consolas', monospace;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-left: 0;
}

.code-block pre {
    margin: 0;
    margin-left: 0;
    padding: 0;
    font-family: 'Fira Code', monospace;
    white-space: pre;
    display: block;
    width: calc(100% + 0.5rem);
    font-size: 0.75rem;
    margin-left: -0.3rem;
}

.code-block pre * {
    font-size: inherit;
}

.code-block pre {
    margin: 0;
    font-family: 'Fira Code', monospace;
}

/* Syntax highlighting (plateado) */
.token-keyword { color: #b91c1c; font-weight: 700; }
.token-class { color: #1d4ed8; font-weight: 700; }
.token-string { color: #b45309; }
.token-comment { color: #6b7280; font-style: italic; }
.token-function { color: #047857; }
.token-variable { color: #be185d; }
.token-number { color: #7c3aed; }

/* Lab code blocks (oscuro) — IDE style, One Dark Pro */
.lab-code-block {
    /* background: linear-gradient(145deg, #1a1b26 0%, #0f1117 100%); */
    border: 1px solid #2a2f5e;
    border-radius: 12px;
    padding: 1.25rem;
    overflow-x: auto;
    line-height: 1.75;
    font-size: 0.875rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.lab-code-block pre,
.lab-code-block code {
    color: #abb2bf;
    margin: 0;
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-feature-settings: "calt" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    line-height: 1.75;
}

/* Tokens — paleta One Dark Pro */
.lab-code-block .token-keyword    { color: #c678dd; }
.lab-code-block .token-class      { color: #61afef; }
.lab-code-block .token-function   { color: #61afef; }
.lab-code-block .token-string     { color: #98c379; }
.lab-code-block .token-comment    { color: #5c6370; font-style: italic; }
.lab-code-block .token-variable   { color: #e06c75; }
.lab-code-block .token-number     { color: #d19a66; }
.lab-code-block .token-type       { color: #56b6c2; }   /* int, String, double, List... */
.lab-code-block .token-annotation { color: #c678dd; }   /* @Override, @FunctionalInterface */
.lab-code-block .token-constant   { color: #d19a66; }

/* ==================== DARK CODE BLOCKS (bg-slate-900) ==================== */
/* Color base del contenedor — los hijos lo heredan si no tienen clase propia */
.bg-slate-900.rounded-lg,
.bg-slate-900.rounded-xl,
.bg-slate-900.font-mono {
    color: #abb2bf;
}

/* Tokens One Dark Pro — mayor especificidad que Tailwind para asegurar el color correcto */
.bg-slate-900 .token-keyword    { color: #c678dd !important; }
.bg-slate-900 .token-class      { color: #61afef !important; }
.bg-slate-900 .token-string     { color: #98c379 !important; }
.bg-slate-900 .token-comment    { color: #5c6370 !important; font-style: italic; }
.bg-slate-900 .token-function   { color: #61afef !important; }
.bg-slate-900 .token-variable   { color: #e06c75 !important; }
.bg-slate-900 .token-number     { color: #d19a66 !important; }
.bg-slate-900 .token-type       { color: #56b6c2 !important; }
.bg-slate-900 .token-annotation { color: #c678dd !important; }
.bg-slate-900 .token-constant   { color: #d19a66 !important; }

/* ==================== ACCESS MODIFIERS ==================== */
.access-private {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    color: #dc2626;
    font-weight: 600;
    transition: all 0.2s ease;
}

.access-private:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.access-public {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    color: #059669;
    font-weight: 600;
    transition: all 0.2s ease;
}

.access-public:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==================== DRAG & DROP ==================== */
.draggable-code {
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
    cursor: pointer;
}

.draggable-code:hover {
    transform: scale(1.05);
}

.drag-over {
    background-color: rgba(251, 191, 36, 0.2) !important;
    border: 2px dashed #fbbf24 !important;
    transform: scale(1.05);
}

/* ==================== DROP ZONE LAB ==================== */
.drop-zone-lab {
    background: linear-gradient(145deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    background-image: 
        radial-gradient(circle at 20px 20px, rgba(99, 102, 241, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 40px 40px, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    min-height: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 16px;
}

.drop-zone-lab:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.drop-zone-lab.drag-over {
    background-color: rgba(99, 102, 241, 0.2);
    border: 2px dashed #6366f1;
}

/* ==================== DROP SLOT ==================== */
.drop-slot {
    background: linear-gradient(145deg, #334155 0%, #1e293b 100%);
    border: 2px dashed #475569;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 100px;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
}

.drop-slot:hover {
    border-color: #6366f1;
    background: linear-gradient(145deg, #3b4f69 0%, #263345 100%);
}

.drop-slot.correct {
    background: linear-gradient(145deg, #166534 0%, #14532d 100%) !important;
    border: 2px solid #22c55e !important;
    color: #dcfce7 !important;
    animation: correctPulse 0.5s ease-out;
}

.drop-slot.incorrect {
    background: linear-gradient(145deg, #991b1b 0%, #7f1d1d 100%) !important;
    border: 2px solid #ef4444 !important;
    color: #fecaca !important;
    animation: shake 0.5s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==================== DROP ZONE ==================== */
.drop-zone {
    background: 
        radial-gradient(circle at 20px 20px, rgba(99, 102, 241, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 40px 40px, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    min-height: 150px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 12px;
}

.drop-zone:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.drop-zone.drag-over {
    background-color: rgba(99, 102, 241, 0.15);
    border: 2px dashed #6366f1;
}

/* ==================== FLIP CARDS ==================== */
.perspective-1000 {
    perspective: 1000px;
    height: 320px;
    width: 100%;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.perspective-1000.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
}

.card-back {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    transform: rotateY(180deg);
    border: 2px solid #86efac;
}

/* ==================== CONSTRUCTOR OPTIONS ==================== */
.constructor-option {
    background: linear-gradient(145deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 2px solid #6366f1;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    color: #1e1b4b;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
}

.constructor-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    border-color: #818cf8;
    background: linear-gradient(145deg, #eef2ff 0%, #ddd6fe 100%);
}

.constructor-option:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.constructor-option.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

/* Drop zone for constructor */
#constructor-drop-zone {
    background: linear-gradient(145deg, #334155 0%, #1e293b 100%);
    border: 3px dashed #6366f1;
}

#constructor-drop-zone.drag-over {
    background-color: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
}
.draggable-item {
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.draggable-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #38bdf8;
}

.draggable-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

/* ==================== CONSTRUCTOR OPTIONS ==================== */
.constructor-option {
    background: linear-gradient(145deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 2px solid #6366f1;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    color: #1e1b4b;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
}

.constructor-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    border-color: #818cf8;
    background: linear-gradient(145deg, #eef2ff 0%, #ddd6fe 100%);
}

.constructor-option:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.constructor-option.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-out forwards;
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }
.toast.warning { border-left-color: #f59e0b; }

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    color: #374151;
    font-size: 0.875rem;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #4b5563;
    background: #f3f4f6;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ==================== LAB CONTENT ==================== */
.lab-content {
    animation: fadeIn 0.3s ease-out;
}

.lab-content.hidden {
    display: none;
}

.lab-completed::after {
    content: '✅ Completado';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .perspective-1000 {
        height: 280px;
    }
    
    .drop-zone-lab {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .lab-code-block {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* ==================== UTILITIES ==================== */
.hidden { display: none; }
.sticky { position: sticky; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.m-auto { margin: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.border { border: 1px solid #e5e7eb; }
.border-2 { border: 2px solid #e5e7eb; }
.border-3 { border: 3px solid #e5e7eb; }
.border-dashed { border-style: dashed; }
.border-green-400 { border-color: #4ade80; }
.border-red-400 { border-color: #f87171; }
.border-indigo-300 { border-color: #a5b4fc; }
.border-indigo-500 { border-color: #6366f1; }
.bg-white { background-color: white; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-pink-600 { background-color: #db2777; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.bg-white-20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-white-10:hover { background-color: rgba(255, 255, 255, 0.1); }
.hover-bg-indigo-50:hover { background-color: #eef2ff; }
.hover-bg-pink-50:hover { background-color: #fdf2f8; }
.backdrop-blur { backdrop-filter: blur(8px); }
.text-white { color: white; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-indigo-600 { color: #4f46e5; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-red-600 { color: #dc2626; }
.font-mono { font-family: 'Fira Code', monospace; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.transition-all { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.duration-500 { transition-duration: 500ms; }
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)); }
.transform-style-3d { transform-style: preserve-3d; }
.group:hover .group-hover\:scale-105 { transform: scale(1.05); }

/* ==================== EJEMPLOS INTERACTIVOS ==================== */
/* (reglas unificadas con el bloque Lab code blocks de arriba — sin duplicar) */


/* ============================================================
   EXAM — Sección de Examen Formal
   ============================================================ */

.exam-screen,
.guide-screen { width: 100%; }

.exam-mode-btn {
  padding: .6rem 1.4rem;
  border-radius: .6rem;
  border: 2px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.exam-mode-btn.active,
.exam-mode-btn:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,.15);
  color: #a5b4fc;
}

.exam-topic-btn {
  padding: .5rem .75rem;
  border-radius: .5rem;
  border: 1.5px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s, color .2s;
}
.exam-topic-btn.active,
.exam-topic-btn:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,.18);
  color: #c7d2fe;
}

.exam-progress-track {
  height: 6px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
}
.exam-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px;
  transition: width .3s ease;
}

.exam-timer-display {
  font-size: 1.3rem;
  font-weight: 700;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.exam-timer-display.danger {
  color: #ef4444;
  animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

.exam-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: .6rem;
  border: 2px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  font-size: .95rem;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.exam-option:hover:not(:disabled) {
  border-color: #6366f1;
  background: rgba(99,102,241,.12);
}
.exam-option.selected {
  border-color: #6366f1;
  background: rgba(99,102,241,.18);
  color: #c7d2fe;
}
.exam-option.correct {
  border-color: #22c55e;
  background: rgba(34,197,94,.15);
  color: #86efac;
}
.exam-option.incorrect {
  border-color: #ef4444;
  background: rgba(239,68,68,.12);
  color: #fca5a5;
}
.exam-option:disabled { cursor: default; }

.exam-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0f172a;
  border: 1.5px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
  color: #94a3b8;
}
.exam-option.selected  .exam-option-letter { background: #6366f1; border-color: #6366f1; color: #fff; }
.exam-option.correct   .exam-option-letter { background: #22c55e; border-color: #22c55e; color: #fff; }
.exam-option.incorrect .exam-option-letter { background: #ef4444; border-color: #ef4444; color: #fff; }

.exam-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #334155;
  background: #1e293b;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: border-color .15s, background .15s;
}
.exam-dot:hover            { border-color: #6366f1; }
.exam-dot.answered         { background: #6366f1; border-color: #6366f1; color: #fff; }
.exam-dot.current          { border-color: #f59e0b; color: #f59e0b; }
.exam-dot.answered.current { background: #6366f1; border-color: #f59e0b; color: #fff; }

.exam-result-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  margin: 0 auto;
}
.exam-result-circle.pass { border-color: #22c55e; }
.exam-result-circle.fail { border-color: #ef4444; }
.exam-result-pct      { font-size: 1.8rem; font-weight: 800; }
.exam-result-fraction { font-size: .75rem; color: #94a3b8; }
.exam-result-verdict  { font-size: 1rem; font-weight: 700; margin-top: .25rem; }

.exam-topic-row      { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.exam-topic-name     { width: 140px; flex-shrink: 0; color: #cbd5e1; }
.exam-topic-bar-wrap { flex: 1; height: 8px; background: #1e293b; border-radius: 99px; overflow: hidden; }
.exam-topic-bar      { height: 100%; border-radius: 99px; transition: width .5s ease; }
.exam-topic-score    { width: 40px; text-align: right; color: #94a3b8; font-size: .8rem; flex-shrink: 0; }

.exam-review-item {
  border: 1.5px solid #334155;
  border-radius: .6rem;
  padding: .85rem 1rem;
  background: #1e293b;
  font-size: .875rem;
}
.exam-review-item .correct-answer { color: #86efac; font-weight: 600; }
.exam-review-item .wrong-answer   { color: #fca5a5; text-decoration: line-through; }
.exam-review-explanation          { color: #94a3b8; font-size: .8rem; margin-top: .35rem; }

/* ============================================================
   GUIDE — Guía Integradora de Proyectos
   ============================================================ */

.guide-project-card {
  border: 1.5px solid #334155;
  border-radius: .75rem;
  padding: 1.25rem;
  background: #1e293b;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.guide-project-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 20px rgba(99,102,241,.2);
  transform: translateY(-2px);
}
.guide-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.guide-card-icon  { font-size: 2rem; line-height: 1; }
.guide-diff-badge { font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; }
.guide-card-name  { font-size: 1rem; font-weight: 700; color: #e2e8f0; }
.guide-card-topic { font-size: .78rem; color: #94a3b8; }
.guide-card-desc  { font-size: .82rem; color: #64748b; flex: 1; }
.guide-start-btn {
  margin-top: .5rem;
  padding: .45rem .9rem;
  border-radius: .5rem;
  border: 1.5px solid #6366f1;
  background: rgba(99,102,241,.12);
  color: #a5b4fc;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  align-self: flex-start;
}
.guide-start-btn:hover { background: rgba(99,102,241,.25); }

.guide-req-block {
  border: 1.5px solid #334155;
  border-radius: .6rem;
  padding: 1rem;
  background: #1e293b;
}
.guide-req-label {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .9rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: .5rem;
}
.guide-req-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-req-hint {
  font-size: .78rem;
  color: #6366f1;
  cursor: pointer;
  margin-bottom: .4rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.guide-req-hint:hover { color: #a5b4fc; }
.guide-hint-text {
  font-size: .8rem;
  color: #94a3b8;
  background: rgba(99,102,241,.08);
  border-left: 3px solid #6366f1;
  padding: .4rem .7rem;
  border-radius: 0 .4rem .4rem 0;
  margin-bottom: .5rem;
}
.guide-req-textarea {
  width: 100%;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: .5rem;
  color: #e2e8f0;
  padding: .6rem .8rem;
  font-size: .875rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.guide-req-textarea:focus { border-color: #6366f1; }
.guide-req-textarea::placeholder { color: #475569; }

.guide-checklist-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: .5rem;
  border: 1.5px solid #334155;
  background: #1e293b;
  font-size: .85rem;
  color: #cbd5e1;
}
.guide-checklist-item.passed { border-color: #22c55e; background: rgba(34,197,94,.08); color: #86efac; }
.guide-checklist-item.failed { border-color: #ef4444; background: rgba(239,68,68,.08); color: #fca5a5; }
.guide-check-icon  { font-size: 1.1rem; flex-shrink: 0; }
.guide-check-label { flex: 1; }
.guide-check-req   {
  font-size: .7rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245,158,11,.12);
  padding: .15rem .45rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.req-document { border: 1.5px solid #334155; border-radius: .75rem; overflow: hidden; background: #1e293b; }
.req-doc-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}
.req-doc-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.req-doc-table thead th {
  background: #0f172a;
  color: #94a3b8;
  text-align: left;
  padding: .6rem 1rem;
  border-bottom: 1px solid #334155;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.req-doc-table tbody tr:nth-child(odd)  { background: #1e293b; }
.req-doc-table tbody tr:nth-child(even) { background: rgba(99,102,241,.04); }
.req-doc-question { padding: .7rem 1rem; color: #94a3b8; vertical-align: top; width: 45%; }
.req-doc-answer   { padding: .7rem 1rem; color: #e2e8f0; vertical-align: top; }
.req-doc-footer   { font-size: .75rem; color: #64748b; padding: .75rem 1rem; border-top: 1px solid #334155; }

.guide-doc-uml-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0 .5rem;
}
.guide-doc-uml-pct { font-size: 1.8rem; font-weight: 800; }
.guide-doc-checklist-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; padding: .2rem 0; }

@media (max-width: 640px) {
  .exam-topic-btn   { font-size: .72rem; padding: .4rem .55rem; }
  .exam-topic-name  { width: 100px; }
  .guide-project-card { padding: .9rem; }
  .req-doc-question { width: 40%; font-size: .78rem; }
  .req-doc-answer   { font-size: .78rem; }
}

/* ══════════════════════════════════════════════════════════
   TUTORIAL INTERACTIVO — Estilos
══════════════════════════════════════════════════════════ */

/* Botones en las tarjetas de proyecto */
.guide-project-card { cursor: default; }
.guide-card-actions { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.guide-tutorial-btn {
  padding: .42rem .9rem;
  border-radius: .5rem;
  border: 1.5px solid #0ea5e9;
  background: rgba(14,165,233,.1);
  color: #38bdf8;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  text-align: left;
}
.guide-tutorial-btn:hover { background: rgba(14,165,233,.22); }

/* Layout del tutorial */
.tut-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  min-height: 520px;
  border: 1.5px solid #334155;
  border-radius: .75rem;
  overflow: hidden;
}

/* Sidebar */
.tut-sidebar {
  background: #0f172a;
  border-right: 1.5px solid #1e293b;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.tut-back-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: .8rem;
  cursor: pointer;
  text-align: left;
  padding: .3rem 0;
  margin-bottom: .25rem;
}
.tut-back-btn:hover { color: #94a3b8; }
.tut-sidebar-title {
  font-size: .7rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.tut-sidebar-progress { margin-bottom: .5rem; }
.tut-sidebar-pct { font-size: .75rem; color: #64748b; margin-bottom: .3rem; }
.tut-progress-track { height: 4px; background: #1e293b; border-radius: 99px; overflow: hidden; }
.tut-progress-fill  { height: 100%; background: linear-gradient(90deg, #0ea5e9, #a855f7); border-radius: 99px; transition: width .4s; }

.tut-nav-step {
  display: flex;
  align-items: center;
  gap: .45rem;
  width: 100%;
  padding: .4rem .5rem;
  border-radius: .4rem;
  border: none;
  background: none;
  color: #64748b;
  font-size: .78rem;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.tut-nav-step:hover  { background: #1e293b; color: #94a3b8; }
.tut-nav-step--active { background: #1e3a5f; color: #38bdf8; font-weight: 600; }
.tut-nav-step--done   { color: #22c55e; }
.tut-nav-icon { font-size: .8rem; flex-shrink: 0; }
.tut-nav-label { line-height: 1.2; }

/* Main content */
.tut-main {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 600px;
}

/* Header del paso */
.tut-step-header { border-bottom: 1px solid #1e293b; padding-bottom: .75rem; }
.tut-step-meta   { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.tut-step-num    { font-size: .72rem; color: #475569; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tut-step-status { font-size: .72rem; color: #22c55e; }
.tut-step-title  { font-size: 1.15rem; font-weight: 700; color: #e2e8f0; }

/* Explicación */
.tut-explanation { font-size: .88rem; color: #94a3b8; line-height: 1.65; }
.tut-explanation p { margin-bottom: .5rem; }
.tut-exp-mt { margin-top: .5rem !important; }
.tut-explanation code {
  background: #1e293b;
  color: #38bdf8;
  padding: .1em .35em;
  border-radius: .25rem;
  font-family: 'Fira Code', monospace;
  font-size: .85em;
}
.tut-class-list {
  list-style: none;
  padding: 0;
  margin: .5rem 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.tut-class-list li { font-size: .85rem; color: #94a3b8; display: flex; align-items: center; gap: .5rem; }
.tut-concept-list { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-direction: column; gap: .25rem; }
.tut-concept-list li { font-size: .85rem; color: #94a3b8; }
.tut-ordered-list { padding-left: 1.2rem; margin: .4rem 0; display: flex; flex-direction: column; gap: .2rem; }
.tut-ordered-list li { font-size: .85rem; color: #94a3b8; }
.tut-note { font-size: .8rem; color: #475569; font-style: italic; }

.tut-badge {
  display: inline-block;
  padding: .1em .55em;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.tut-badge-green  { background: rgba(34,197,94,.15);  color: #22c55e; }
.tut-badge-blue   { background: rgba(14,165,233,.15); color: #38bdf8; }
.tut-badge-purple { background: rgba(168,85,247,.15); color: #a855f7; }
.tut-badge-orange { background: rgba(249,115,22,.15); color: #f97316; }

.tut-highlight-box {
  background: #1e293b;
  border-left: 3px solid #0ea5e9;
  border-radius: 0 .4rem .4rem 0;
  padding: .65rem .9rem;
  font-size: .82rem;
  color: #94a3b8;
  margin-top: .5rem;
}
.tut-highlight-box code { background: #0f172a; color: #38bdf8; padding: .1em .3em; border-radius: .2rem; font-family: monospace; }
.tut-highlight-green { border-left-color: #22c55e; }

/* Bloque de código */
.tut-code-wrap {
  border: 1.5px solid #1e293b;
  border-radius: .5rem;
  overflow: hidden;
}
.tut-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  padding: .4rem .75rem;
  border-bottom: 1px solid #1e293b;
}
.tut-code-lang { font-size: .7rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .06em; }
.tut-copy-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: .72rem;
  cursor: pointer;
  transition: color .15s;
}
.tut-copy-btn:hover { color: #94a3b8; }
.tut-code-block {
  margin: 0;
  padding: 1rem;
  background: #020617;
  overflow-x: auto;
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: .78rem;
  line-height: 1.6;
  color: #94a3b8;
  white-space: pre;
}
/* Syntax highlighting tokens (usados por highlightCode()) */
.tut-code-block .tut-h-kw,
.tut-fill-template .tut-h-kw  { color: #7dd3fc; font-style: normal; font-weight: 600; }
.tut-code-block .tut-h-str,
.tut-fill-template .tut-h-str  { color: #86efac; font-style: normal; }
.tut-code-block .tut-h-cmt,
.tut-fill-template .tut-h-cmt  { color: #475569; font-style: italic; }
.tut-code-block .tut-h-ann,
.tut-fill-template .tut-h-ann  { color: #fbbf24; font-style: normal; }
.tut-code-block .tut-h-num,
.tut-fill-template .tut-h-num  { color: #f9a8d4; font-style: normal; }

/* Área de desafío */
.tut-challenge {
  background: #0f172a;
  border: 1.5px solid #1e3a5f;
  border-radius: .6rem;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.tut-challenge-label {
  font-size: .72rem;
  font-weight: 700;
  color: #0ea5e9;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tut-challenge-prompt { font-size: .88rem; color: #cbd5e1; line-height: 1.55; }
.tut-challenge-prompt code { background: #1e293b; color: #38bdf8; padding: .1em .3em; border-radius: .2rem; font-family: monospace; font-size: .9em; }

/* Quiz */
.tut-quiz-options { display: flex; flex-direction: column; gap: .4rem; }
.tut-quiz-option {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .55rem .8rem;
  border-radius: .4rem;
  border: 1.5px solid #1e293b;
  background: #1e293b;
  cursor: pointer;
  font-size: .84rem;
  color: #94a3b8;
  transition: border-color .15s, background .15s;
}
.tut-quiz-option:hover { border-color: #334155; background: #253347; }
.tut-quiz-option--selected { border-color: #0ea5e9; background: rgba(14,165,233,.1); color: #e2e8f0; }
.tut-quiz-option--correct  { border-color: #22c55e !important; background: rgba(34,197,94,.1) !important; color: #22c55e !important; }
.tut-quiz-option--wrong    { border-color: #ef4444 !important; background: rgba(239,68,68,.1) !important; color: #ef4444 !important; }
.tut-quiz-option input     { margin-top: .15rem; flex-shrink: 0; }

/* Fill blank */
.tut-fill-template {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: .4rem;
  padding: .75rem 1rem;
  font-family: 'Fira Code', monospace;
  font-size: .78rem;
  color: #94a3b8;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.7;
}
.tut-blank-input {
  display: inline-block;
  background: #1e293b;
  border: 1.5px solid #334155;
  border-radius: .3rem;
  color: #e2e8f0;
  font-family: 'Fira Code', monospace;
  font-size: .78rem;
  padding: .05em .4em;
  width: 110px;
  outline: none;
  vertical-align: middle;
  transition: border-color .15s;
}
.tut-blank-input:focus  { border-color: #0ea5e9; }
.tut-blank--ok  { border-color: #22c55e !important; color: #22c55e !important; }
.tut-blank--err { border-color: #ef4444 !important; color: #ef4444 !important; }

.tut-hint-row { display: flex; align-items: center; }
.tut-hint-btn {
  background: none;
  border: none;
  color: #f59e0b;
  font-size: .8rem;
  cursor: pointer;
  padding: 0;
}
.tut-hint-btn:hover { text-decoration: underline; }
.tut-hint-txt {
  font-size: .8rem;
  color: #f59e0b;
  background: rgba(245,158,11,.08);
  border-left: 2px solid #f59e0b;
  padding: .4rem .7rem;
  border-radius: 0 .3rem .3rem 0;
}

/* Feedback */
.tut-feedback {
  font-size: .83rem;
  padding: .5rem .75rem;
  border-radius: .4rem;
  line-height: 1.45;
}
.tut-feedback--ok  { background: rgba(34,197,94,.1);  color: #22c55e; border: 1px solid rgba(34,197,94,.25); }
.tut-feedback--err { background: rgba(239,68,68,.1);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }

/* Botones de verificar / confirmar */
.tut-verify-btn {
  padding: .45rem 1.1rem;
  border-radius: .45rem;
  border: none;
  background: #0ea5e9;
  color: #fff;
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  align-self: flex-start;
}
.tut-verify-btn:hover    { background: #0284c7; }
.tut-verify-btn:disabled { background: #334155; color: #64748b; cursor: default; }
.tut-confirm-btn {
  padding: .45rem 1.2rem;
  border-radius: .45rem;
  border: 1.5px solid #22c55e;
  background: rgba(34,197,94,.1);
  color: #22c55e;
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.tut-confirm-btn:hover { background: rgba(34,197,94,.2); }

/* Botones de navegación */
.tut-nav-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .5rem;
  border-top: 1px solid #1e293b;
  margin-top: .25rem;
}
.tut-btn-prev {
  padding: .42rem .9rem;
  border-radius: .4rem;
  border: 1.5px solid #334155;
  background: none;
  color: #64748b;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tut-btn-prev:hover:not(.tut-btn--disabled) { border-color: #94a3b8; color: #94a3b8; }
.tut-btn--disabled { opacity: .35; cursor: default; }
.tut-btn-next {
  padding: .42rem 1rem;
  border-radius: .4rem;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.tut-btn-next:hover { background: #4f46e5; }
.tut-btn-finish {
  padding: .42rem 1rem;
  border-radius: .4rem;
  border: none;
  background: #22c55e;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.tut-btn-finish:hover { background: #16a34a; }
.tut-btn--muted { background: #334155; color: #94a3b8; }
.tut-btn--muted:hover { background: #334155; }

/* Responsive */
@media (max-width: 640px) {
  .tut-layout { grid-template-columns: 1fr; }
  .tut-sidebar { display: none; }
  .tut-main { padding: 1rem; max-height: none; }
}

/* ============================================================
   JAVA → UML PANEL
   ============================================================ */

/* Botón topbar UML */
.uml-j2u-btn {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff !important;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: .35rem;
  border: none;
  letter-spacing: .02em;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.uml-j2u-btn:hover { opacity: .85; }

/* Overlay de fondo */
.j2u-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.7);
  backdrop-filter: blur(3px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.j2u-panel-overlay.hidden { display: none; }

/* Caja del panel */
.j2u-panel-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 1rem;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,.6);
}

/* Cabecera del panel */
.j2u-panel-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #1e293b;
  background: #0a0f1e;
  flex-shrink: 0;
}
.j2u-panel-title {
  font-size: 1rem;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: .03em;
}
.j2u-panel-tabs { display: flex; gap: .4rem; margin-left: .5rem; }
.j2u-tab {
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: .4rem;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all .15s;
}
.j2u-tab:hover { color: #e2e8f0; border-color: #475569; }
.j2u-tab--active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.j2u-close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: .3rem;
  line-height: 1;
  transition: color .15s;
}
.j2u-close-btn:hover { color: #f87171; }

/* Pane (pestaña interior) */
.j2u-pane {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Hint superior */
.j2u-hint {
  font-size: .8rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}
.j2u-hint code { background: #1e293b; padding: .1em .3em; border-radius: .25em; color: #7dd3fc; }

/* Botones de ejemplo rapido */
.j2u-example-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.j2u-example-label {
  font-size: .72rem;
  color: #64748b;
  font-weight: 600;
  margin-right: .2rem;
}
.j2u-example-btns button {
  font-size: .73rem;
  padding: .22rem .55rem;
  border-radius: .35rem;
  border: 1px solid #334155;
  background: #1e293b;
  color: #cbd5e1;
  cursor: pointer;
  transition: all .15s;
  font-weight: 600;
}
.j2u-example-btns button:hover { background: #273449; border-color: #4f46e5; color: #fff; }

/* Textarea principal */
.j2u-textarea {
  width: 100%;
  min-height: 200px;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: .5rem;
  color: #7ee787;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .78rem;
  line-height: 1.65;
  padding: .75rem;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
  tab-size: 4;
}
.j2u-textarea:focus { border-color: #4f46e5; }

/* Vista previa del analisis */
.j2u-preview { border-radius: .5rem; overflow: hidden; }
.j2u-preview.hidden { display: none; }

.j2u-preview-ok {
  background: #0a1628;
  border: 1px solid #1d4ed8;
  border-radius: .5rem;
  padding: .75rem;
}
.j2u-preview-title {
  font-size: .82rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: .5rem;
}
.j2u-preview-list {
  list-style: none;
  margin: 0 0 .5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.j2u-preview-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: #cbd5e1;
}
.j2u-preview-stats {
  font-size: .7rem;
  color: #64748b;
  margin-left: auto;
}

/* Badges de tipo de clase */
.j2u-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .1em .45em;
  border-radius: .3em;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.j2u-badge-class     { background: #1e3a5f; color: #60a5fa; }
.j2u-badge-abstract  { background: #3b1f5e; color: #c084fc; }
.j2u-badge-interface { background: #064e3b; color: #34d399; }

/* Chips de relaciones */
.j2u-preview-rels {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-top: .4rem;
}
.j2u-rels-label { font-size: .7rem; color: #64748b; font-weight: 600; }
.j2u-rel-chip {
  font-size: .68rem;
  padding: .15em .5em;
  border-radius: .3em;
  border: 1px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: .3em;
}
.j2u-rel-chip em { font-style: normal; color: #64748b; font-size: .65rem; }
.j2u-rel-herencia    { border-color: #1d4ed8; color: #60a5fa; }
.j2u-rel-dependencia { border-color: #991b1b; color: #f87171; }
.j2u-rel-asociacion  { border-color: #581c87; color: #c084fc; }
.j2u-rel-composicion { border-color: #14532d; color: #4ade80; }

.j2u-no-rels { font-size: .75rem; color: #475569; margin: .4rem 0 0; }
.j2u-preview-err {
  background: #1c0a0a;
  border: 1px solid #7f1d1d;
  border-radius: .5rem;
  padding: .65rem .85rem;
  font-size: .8rem;
  color: #fca5a5;
}

/* Acciones inferiores */
.j2u-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .25rem;
}
.j2u-append-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: #94a3b8;
  cursor: pointer;
}
.j2u-append-label input { accent-color: #4f46e5; }
.j2u-action-btns { display: flex; gap: .5rem; }

.j2u-analyze-btn, .j2u-generate-btn {
  font-size: .8rem;
  font-weight: 700;
  padding: .45rem 1rem;
  border-radius: .5rem;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.j2u-analyze-btn {
  background: #1e3a5f;
  color: #7dd3fc;
  border: 1px solid #1d4ed8;
}
.j2u-analyze-btn:hover { background: #1d4ed8; color: #fff; }

.j2u-generate-btn {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
}
.j2u-generate-btn:hover:not(:disabled) { opacity: .85; }
.j2u-generate-btn:disabled {
  background: #1e293b;
  color: #475569;
  cursor: not-allowed;
}

/* TUTORIAL INTERACTIVO */
.j2u-tut-step { display: flex; flex-direction: column; gap: .9rem; }

.j2u-tut-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.j2u-tut-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: .1rem;
}
.j2u-tut-meta { font-size: .68rem; color: #64748b; margin-bottom: .15rem; }
.j2u-tut-title { font-size: 1.05rem; font-weight: 800; color: #e2e8f0; }

.j2u-tut-body {
  font-size: .82rem;
  color: #94a3b8;
  line-height: 1.65;
}
.j2u-tut-body p { margin: 0 0 .5rem; }
.j2u-tut-body code {
  background: #1e293b;
  padding: .1em .35em;
  border-radius: .25em;
  color: #7dd3fc;
  font-size: .78rem;
}
.j2u-tut-mt { margin-top: .5rem !important; }
.j2u-tut-list {
  padding-left: 1.2em;
  margin: .4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.j2u-tut-list li { color: #94a3b8; }
.j2u-tut-steps {
  padding-left: 0;
  margin: .4rem 0 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.j2u-tut-steps li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .82rem;
  color: #94a3b8;
}
.j2u-step-num {
  background: #4f46e5;
  color: #fff;
  font-weight: 800;
  font-size: .7rem;
  border-radius: 50%;
  width: 1.4em;
  height: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* Bloque de codigo en tutorial */
.j2u-tut-code {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: .45rem;
  padding: .65rem .85rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .73rem;
  line-height: 1.7;
  color: #7ee787;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.j2u-hl-pub    { color: #60a5fa; font-weight: 700; }
.j2u-hl-priv   { color: #f87171; }
.j2u-hl-prot   { color: #fb923c; }
.j2u-hl-abs    { color: #c084fc; font-weight: 700; }
.j2u-hl-key    { color: #fbbf24; font-weight: 700; }
.j2u-hl-cls    { color: #34d399; }
.j2u-hl-comment { color: #475569; font-style: italic; }

/* Boton de carga de ejemplo dentro del tutorial */
.j2u-tut-load-btn {
  margin-top: .5rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem .9rem;
  border-radius: .4rem;
  cursor: pointer;
  transition: all .15s;
  display: inline-block;
}
.j2u-tut-load-btn:hover { background: #273449; border-color: #4f46e5; }

/* Puntos de navegacion */
.j2u-tut-dots {
  display: flex;
  justify-content: center;
  gap: .45rem;
  padding: .25rem 0;
}
.j2u-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #334155;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.j2u-dot:hover { background: #475569; }
.j2u-dot--active { background: #4f46e5; transform: scale(1.25); }

/* Botones de navegacion del tutorial */
.j2u-tut-nav {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .25rem;
}
.j2u-tut-prev, .j2u-tut-next, .j2u-tut-finish {
  font-size: .8rem;
  font-weight: 700;
  padding: .4rem .9rem;
  border-radius: .4rem;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.j2u-tut-prev { background: #1e293b; color: #94a3b8; }
.j2u-tut-prev:hover:not(:disabled) { background: #273449; color: #e2e8f0; }
.j2u-tut-btn--disabled { opacity: .4; cursor: not-allowed; }
.j2u-tut-next { background: #1e3a5f; color: #7dd3fc; }
.j2u-tut-next:hover { background: #1d4ed8; color: #fff; }
.j2u-tut-finish { background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; }
.j2u-tut-finish:hover { opacity: .85; }

@media (max-width: 640px) {
  .j2u-panel-box { max-height: 95vh; }
  .j2u-actions { flex-direction: column; align-items: stretch; }
  .j2u-action-btns { justify-content: stretch; }
  .j2u-analyze-btn, .j2u-generate-btn { flex: 1; }
}

/* ============================================================
   ROADMAP — Mapa visual de aprendizaje
   ============================================================ */

/* Grid de nodos */
.rm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px)  { .rm-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .rm-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

/* NODO */
.rm-node {
    flex: 1;
    min-width: 0;
    padding: 1rem 0.75rem;
    border-radius: 1.25rem;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    user-select: none;
}
.rm-node:hover { transform: translateY(-3px) scale(1.03); }

/* Estados */
.rm-node--available {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 6px 20px -6px rgba(99,102,241,0.45);
}
.rm-node--available:hover {
    box-shadow: 0 12px 28px -6px rgba(99,102,241,0.55);
}

.rm-node--done {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: rgba(16,185,129,0.4);
    box-shadow: 0 6px 20px -6px rgba(16,185,129,0.4);
}
.rm-node--done:hover {
    box-shadow: 0 12px 28px -6px rgba(16,185,129,0.55);
}

.rm-node--locked {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: pointer;
}
.rm-node--locked:hover {
    background: #e2e8f0;
    box-shadow: 0 6px 16px -4px rgba(0,0,0,0.08);
}

/* Contenido del nodo */
.rm-node__num {
    font-size: 0.65rem;
    font-weight: 800;
    opacity: 0.7;
    margin-bottom: 2px;
}
.rm-node--available .rm-node__num,
.rm-node--done .rm-node__num { opacity: 0.85; }

.rm-node__emoji {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 4px;
}

.rm-node__title {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

/* Badge de completado */
.rm-node__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #fbbf24;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 900;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Animación "shake" para código incorrecto */
@keyframes rm-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.rm-shake { animation: rm-shake 0.4s ease-in-out; }

/* Confetti */
.rm-confetti-particle {
    position: absolute;
    top: -12px;
    animation: rm-confetti-fall linear forwards;
}
@keyframes rm-confetti-fall {
    0%   { transform: translateY(0)    rotate(0deg);   opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ==================== BIENVENIDA ==================== */
@keyframes welcomePop {
    0%   { opacity: 0; transform: scale(.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==================== IMPRESIÓN — SIN PÁGINAS EN BLANCO ==================== */
@media print {
    /* Solo muestra el contenido activo, oculta todo lo demás */
    header,
    #mobile-menu,
    #learn-tabs-nav,
    #global-progress-bar,
    [id^="mode-"][id$="-content"].hidden,
    .rm-confetti-particle,
    #rm-unlock-modal,
    #rm-completion-modal,
    #cert-modal,
    #welcome-modal,
    .toast-container,
    .no-print {
        display: none !important;
    }

    /* Evita páginas en blanco por elementos ocultos con altura residual */
    .hidden { display: none !important; height: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; }

    @page { margin: 1.5cm; size: A4; }

    body { background: white !important; color: #111 !important; font-size: 11pt; }

    h1, h2, h3 { page-break-after: avoid; color: #111 !important; }
    p, li       { orphans: 3; widows: 3; }
    pre, code   { page-break-inside: avoid; }

    /* Secciones de aprendizaje */
    .learn-section { page-break-before: always; }
    .learn-section:first-of-type { page-break-before: auto; }

    /* Bloques de código */
    .bg-slate-900 { background: #f5f5f5 !important; color: #111 !important; border: 1px solid #ccc !important; }
    .bg-slate-900 * { color: #111 !important; }

    /* Ocultar controles interactivos */
    button, input, select, .sq-result, [onclick]:not(a) { display: none !important; }
    a[onclick] { display: inline !important; }
}
