/* ========================================
   ARQUITECTURA.DEV - ESTILOS PRINCIPALES
   Versión 2.0 - Look & Feel Mejorado
   ======================================== */

/* ========================================
   FUENTES Y VARIABLES
   ======================================== */

:root {
    --brand-blue: #2B4994;
    --brand-orange: #ED7A27;
    --brand-cyan: #0099B8;
    --brand-red-orange: #EC5525;
    --brand-darkblue: #334F78;
    --brand-purple: #8867B8;
    --gradient-primary: linear-gradient(135deg, #334F78 0%, #2B4994 100%);
    --gradient-accent: linear-gradient(135deg, #ED7A27 0%, #EC5525 100%);
    --gradient-cool: linear-gradient(135deg, #0099B8 0%, #2B4994 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* ========================================
   SIDEBAR MEJORADO
   ======================================== */

#sidebar {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-xl);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

#sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

#sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-title {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Logo/Brand Header */
.sidebar-logo {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all var(--transition-normal);
}

.sidebar-brand:hover .sidebar-logo {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transform: scale(1.05);
}

/* ========================================
   NAVEGACIÓN MEJORADA
   ======================================== */

.nav-link {
    transition: all var(--transition-normal);
    border-radius: 0.75rem;
    margin-bottom: 0.25rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--brand-orange);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
    border-radius: 0 2px 2px 0;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(43, 73, 148, 0.9) 0%, rgba(43, 73, 148, 0.7) 100%);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(43, 73, 148, 0.4);
}

.nav-link.active::before {
    transform: scaleY(1);
    background: var(--brand-orange);
}

/* Module badge styling */
.nav-link span[class*="border"] {
    transition: all var(--transition-fast);
}

.nav-link:hover span[class*="border"],
.nav-link.active span[class*="border"] {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: white;
}

/* Section dividers */
.nav-section-title {
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* ========================================
   CONTENIDO PRINCIPAL
   ======================================== */

#main-content {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Header móvil mejorado */
#main-content > header {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   MODULE HEADER (nuevo componente)
   ======================================== */

.module-header {
    background: linear-gradient(135deg, rgba(51, 79, 120, 0.05) 0%, rgba(43, 73, 148, 0.08) 100%);
    border-bottom: 1px solid rgba(51, 79, 120, 0.1);
    padding: 1rem 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

.module-header h2 {
    margin: 0;
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress-container {
    background: #e2e8f0;
    border-radius: 9999px;
    height: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--brand-blue);
    border-radius: 9999px;
    transition: width var(--transition-normal);
    position: relative;
}

/* ========================================
   STEPPER NAVIGATION MEJORADO
   ======================================== */

.stepper-nav-fixed {
    flex-shrink: 0;
}

.stepper-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--brand-darkblue);
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
}

.stepper-btn-icon:hover:not(:disabled) {
    background: var(--brand-blue);
    color: white;
    transform: scale(1.1);
}

.stepper-btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stepper-btn-icon.stepper-btn-primary {
    background: var(--brand-blue);
    color: white;
}

.stepper-btn-icon.stepper-btn-primary:hover:not(:disabled) {
    background: var(--brand-darkblue);
}

#step-counter {
    white-space: nowrap;
}

/* Step dots indicator */
.step-dots {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
    align-items: center;
}

.step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    padding: 0;
}

.step-dot:hover {
    background: var(--brand-blue);
    transform: scale(1.3);
}

.step-dot.active {
    background: var(--brand-blue);
    width: 18px;
    border-radius: 3px;
}

/* ========================================
   ANIMACIONES Y TRANSICIONES
   ======================================== */

.content-step {
    display: none;
}

.content-step.active-step {
    display: block;
    animation: fadeInSlide 0.5s ease-out;
}

.content-module {
    display: none;
}

.content-module.active-module {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animations for cards */
.content-step.active-step .bg-white,
.content-step.active-step [class*="border-l-4"],
.content-step.active-step [class*="border-t-4"] {
    animation: fadeInUp 0.5s ease-out backwards;
}

.content-step.active-step .bg-white:nth-child(1),
.content-step.active-step [class*="border-"]:nth-child(1) { animation-delay: 0.05s; }
.content-step.active-step .bg-white:nth-child(2),
.content-step.active-step [class*="border-"]:nth-child(2) { animation-delay: 0.1s; }
.content-step.active-step .bg-white:nth-child(3),
.content-step.active-step [class*="border-"]:nth-child(3) { animation-delay: 0.15s; }
.content-step.active-step .bg-white:nth-child(4),
.content-step.active-step [class*="border-"]:nth-child(4) { animation-delay: 0.2s; }

/* ========================================
   CARDS Y PANELES MEJORADOS
   ======================================== */

/* Cards con hover effect */
.bg-white {
    transition: all var(--transition-normal);
}

.bg-white:hover {
    box-shadow: var(--shadow-lg);
}

/* Cards con borde lateral */
[class*="border-l-4"] {
    transition: all var(--transition-normal);
    position: relative;
}

[class*="border-l-4"]:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

/* Cards con borde superior */
[class*="border-t-4"] {
    transition: all var(--transition-normal);
}

[class*="border-t-4"]:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Info boxes mejorados */
.bg-blue-50,
.bg-orange-50,
.bg-cyan-50,
.bg-purple-50,
.bg-red-50,
.bg-green-50 {
    border-radius: 0.75rem;
    transition: all var(--transition-normal);
}

/* ========================================
   TABLAS MEJORADAS
   ======================================== */

table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

table thead {
    background: var(--gradient-primary);
}

table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

table tbody tr {
    transition: all var(--transition-fast);
}

table tbody tr:hover {
    background-color: rgba(43, 73, 148, 0.05);
}

/* ========================================
   ACCORDION
   ======================================== */

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-header[aria-expanded="true"]+.accordion-content {
    max-height: 1000px;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

/* ========================================
   TASK LIST MEJORADO
   ======================================== */

.task-item {
    transition: all var(--transition-normal);
    border-left-width: 4px;
}

.task-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.task-item.completed span {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-item.completed {
    border-left-color: #9ca3af;
    background-color: #f9fafb;
    opacity: 0.7;
}

/* Custom checkbox */
.task-item input[type="checkbox"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--brand-blue);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.task-item input[type="checkbox"]:checked {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

.task-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.task-item input[type="checkbox"]:hover {
    border-color: var(--brand-orange);
}

/* ========================================
   QUIZ MEJORADO
   ======================================== */

#quiz-form label {
    transition: all var(--transition-fast);
    cursor: pointer;
}

#quiz-form label:hover {
    background-color: rgba(43, 73, 148, 0.05);
    border-color: var(--brand-blue);
}

#quiz-form input[type="radio"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

#quiz-form input[type="radio"]:checked {
    border-color: var(--brand-blue);
    background: white;
}

#quiz-form input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.625rem;
    height: 0.625rem;
    background: var(--brand-blue);
    border-radius: 50%;
}

#quiz-form input[type="radio"]:hover {
    border-color: var(--brand-blue);
}

#quiz-results {
    animation: fadeInUp 0.5s ease-out;
}

/* ========================================
   SIDEBAR MÓVIL
   ======================================== */

/* En móvil el sidebar se desliza desde la izquierda */
@media (max-width: 767px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 40;
    }
}

/* ========================================
   CHART CONTAINER
   ======================================== */

.chart-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    height: 400px;
    max-height: 450px;
    background: white;
    border-radius: 1rem;
    padding: 1rem;
}

/* Scenario buttons */
#btn-scenario-banking,
#btn-scenario-ecommerce,
#btn-scenario-blog {
    transition: all var(--transition-normal);
    font-weight: 600;
}

#btn-scenario-banking:hover,
#btn-scenario-ecommerce:hover,
#btn-scenario-blog:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   DIAGRAMAS TÉCNICOS HTML/CSS
   ======================================== */

.diag-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px solid rgba(51, 79, 120, 0.1);
}

.diag-box {
    border: 2px solid #334F78;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    font-weight: 500;
    color: #334F78;
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.diag-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   DIAGRAMA DE ACOPLAMIENTO (COUPLING)
   ======================================== */

.coupling-diag {
    display: flex;
    gap: 2rem;
}

.coupling-example {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.coupling-example h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coupling-boxes {
    display: flex;
    position: relative;
}

.high-coupling .diag-box {
    background: linear-gradient(135deg, #EC5525 0%, #dc2626 100%);
    color: white;
    border-color: #c2410c;
}

.high-coupling .diag-box:first-child {
    margin-right: -20px;
    z-index: 1;
}

.low-coupling .diag-box {
    background: linear-gradient(135deg, #0099B8 0%, #0891b2 100%);
    color: white;
    border-color: #00677e;
}

.low-coupling .diag-box:first-child {
    margin-right: 3rem;
}

.low-coupling .api-line {
    position: absolute;
    top: 50%;
    left: 100%;
    width: 3rem;
    height: 2px;
    background-color: #334F78;
    transform: translateY(-50%);
}

.low-coupling .api-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border-left: 8px solid #334F78;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

/* ========================================
   DIAGRAMA MONOLÍTICO
   ======================================== */

.monolith-diag {
    width: 200px;
    background: linear-gradient(135deg, #0099B8 0%, #0891b2 100%);
    color: white;
    border-color: #00677e;
    padding: 1rem;
    border-radius: 0.75rem;
}

.monolith-diag div {
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    text-align: center;
    backdrop-filter: blur(4px);
}

/* ========================================
   DIAGRAMA MICROSERVICIOS
   ======================================== */

.microservices-diag {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.microservices-diag .gateway {
    background: linear-gradient(135deg, #8867B8 0%, #7c3aed 100%);
    color: white;
    border-color: #5d4683;
    width: 150px;
    z-index: 1;
}

.microservices-diag .services {
    display: flex;
    gap: 1rem;
}

.microservices-diag .service {
    background: linear-gradient(135deg, #ED7A27 0%, #ea580c 100%);
    color: white;
    border-color: #b95f1e;
    width: 100px;
    z-index: 1;
}

.microservices-diag .connector {
    position: absolute;
    background-color: #334F78;
    width: 2px;
    height: 32px;
    top: 60px;
    z-index: 0;
}

.microservices-diag .connector-horiz {
    position: absolute;
    background-color: #334F78;
    height: 2px;
    width: 228px;
    top: 92px;
    z-index: 0;
}

.microservices-diag .service-line {
    position: absolute;
    background-color: #334F78;
    width: 2px;
    height: 16px;
    top: 92px;
    z-index: 0;
}

.microservices-diag .service-line-1 {
    left: calc(50% - 62px);
}

.microservices-diag .service-line-2 {
    left: 50%;
}

.microservices-diag .service-line-3 {
    left: calc(50% + 62px);
}

/* ========================================
   DIAGRAMA DE CAPAS (LAYERS)
   ======================================== */

.layers-diag {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.layers-diag .diag-box {
    background: linear-gradient(135deg, #8867B8 0%, #7c3aed 100%);
    color: white;
    border-color: #5d4683;
    width: 200px;
}

.layers-diag .diag-box:nth-child(3) {
    opacity: 0.85;
}

.layers-diag .diag-box:nth-child(5) {
    opacity: 0.7;
}

.layers-diag .arrow {
    font-size: 2rem;
    font-weight: 800;
    color: #334F78;
    margin: -0.25rem 0;
}

/* ========================================
   DIAGRAMA C4
   ======================================== */

.c4-diag {
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.c4-diag-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.c4-diag-box:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.c4-1 {
    border-color: #334F78;
    color: #334F78;
    width: 340px;
    min-height: 220px;
    background: linear-gradient(135deg, rgba(51, 79, 120, 0.05) 0%, rgba(51, 79, 120, 0.1) 100%);
}

.c4-2 {
    border-color: #2B4994;
    color: #2B4994;
    border-style: dashed;
    width: 280px;
    min-height: 160px;
    background: linear-gradient(135deg, rgba(43, 73, 148, 0.05) 0%, rgba(43, 73, 148, 0.1) 100%);
}

.c4-3 {
    border-color: #0099B8;
    color: #0099B8;
    width: 220px;
    min-height: 100px;
    background: linear-gradient(135deg, rgba(0, 153, 184, 0.05) 0%, rgba(0, 153, 184, 0.1) 100%);
}

.c4-4 {
    border-color: #ED7A27;
    color: #ED7A27;
    border-style: dashed;
    width: 160px;
    min-height: 40px;
    background: linear-gradient(135deg, rgba(237, 122, 39, 0.05) 0%, rgba(237, 122, 39, 0.1) 100%);
}

/* ========================================
   SCROLLBAR PERSONALIZADO
   ======================================== */

.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Content scrollbar */
#presentation-content::-webkit-scrollbar {
    width: 8px;
}

#presentation-content::-webkit-scrollbar-track {
    background: transparent;
}

#presentation-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#presentation-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   CODE BLOCKS
   ======================================== */

code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 0.375rem;
    border: 1px solid rgba(51, 79, 120, 0.1);
}

/* Bloques de código pre */
pre {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* pre dentro de contenedores con fondo claro - aplicar tema oscuro */
.bg-neutral-100 pre,
.bg-neutral-50 pre {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Bloques pre con bg-gray-100 - convertir a tema oscuro para consistencia */
pre.bg-gray-100 {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

pre.bg-gray-100 code {
    color: #e2e8f0 !important;
}

pre code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e2e8f0;
    background: transparent;
    border: none;
    padding: 0;
    display: block;
    white-space: pre;
}

/* Sintaxis highlighting básico */
pre code .keyword {
    color: #c084fc;
}

pre code .string {
    color: #86efac;
}

pre code .comment {
    color: #64748b;
    font-style: italic;
}

/* ========================================
   RESPONSIVE IMPROVEMENTS
   ======================================== */

@media (max-width: 768px) {
    #stepper-nav {
        padding: 0.75rem 1rem;
    }

    .stepper-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    #step-counter {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .content-step.active-step .bg-white,
    .content-step.active-step [class*="border-l-4"],
    .content-step.active-step [class*="border-t-4"] {
        animation: none;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   NAVEGACIÓN CON SUBMENÚS - Estilo Taurus
   ======================================== */

/* Contenedor de módulo - Nivel 1 */
.nav-module-container {
    margin-bottom: 0.125rem;
}

.nav-link-expandable {
    position: relative;
}

.nav-chevron {
    transition: transform var(--transition-normal);
    flex-shrink: 0;
    opacity: 0.5;
}

.nav-link-expandable:hover .nav-chevron {
    opacity: 0.8;
}

.nav-chevron.rotate-180 {
    transform: rotate(180deg);
    opacity: 1;
}

/* Submenú principal - Nivel 2 (Grupos) */
.nav-submenu {
    margin-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Animación de apertura */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease-out,
                padding 0.25s ease-out;
    padding-top: 0;
    padding-bottom: 0;
}

.nav-submenu:not(.hidden) {
    max-height: 2000px;
    opacity: 1;
    padding-top: 0.25rem;
    padding-bottom: 0.375rem;
}

/* Grupos de submenú - estilo acordeón limpio */
.submenu-group {
    margin-bottom: 0;
}

.submenu-group-header {
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    border-radius: 0.375rem;
    transition: all var(--transition-fast);
    position: relative;
}

/* Línea horizontal conectora del grupo al borde */
.submenu-group-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0.5rem;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.submenu-group-header:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.submenu-group-header .submenu-icon {
    opacity: 0.7;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.submenu-group-header:hover .submenu-icon {
    opacity: 1;
}

.submenu-chevron {
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0.4;
    margin-left: auto;
}

.submenu-group-header:hover .submenu-chevron {
    opacity: 0.7;
}

.submenu-chevron.rotate-90 {
    transform: rotate(90deg);
    opacity: 0.8;
}

/* Steps dentro de los grupos - Nivel 3 */
.submenu-steps {
    position: relative;
    margin-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Animación de apertura */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease-out,
                padding 0.2s ease-out;
    padding-top: 0;
    padding-bottom: 0;
}

.submenu-steps:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.submenu-step {
    position: relative;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.375rem 0.5rem 0.375rem 1rem;
    margin-bottom: 0;
    border-radius: 0.25rem;
    transition: all var(--transition-fast);
    font-size: 0.75rem;
    display: block;
    text-decoration: none;
    line-height: 1.4;
}

/* Línea horizontal conectora del step al borde */
.submenu-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0.5rem;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    transition: all var(--transition-fast);
}

/* Punto indicador */
.submenu-step::after {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.submenu-step:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.06);
}

.submenu-step:hover::after {
    background: rgba(255, 255, 255, 0.6);
    width: 5px;
    height: 5px;
}

.submenu-step.active-step-link {
    color: #ffffff;
    background: rgba(237, 122, 39, 0.15);
}

.submenu-step.active-step-link::before {
    background: var(--brand-orange);
}

.submenu-step.active-step-link::after {
    background: var(--brand-orange);
    width: 6px;
    height: 6px;
    box-shadow: 0 0 6px rgba(237, 122, 39, 0.5);
}

/* Ocultar el badge numérico - usar solo puntos */
.submenu-step .step-number {
    display: none;
}

/* Step title */
.submenu-step .step-title {
    color: inherit;
    white-space: normal;
    line-height: 1.4;
}

/* Modo colapsado - ocultar submenús */
body.sidebar-collapsed .nav-module-container .nav-submenu {
    display: none;
}

body.sidebar-collapsed .nav-module-container .nav-chevron {
    display: none;
}

/* Indicador de progreso en grupo */
.submenu-group-header.completed .submenu-icon {
    color: #10b981;
}

/* Indicador cuando un hijo está activo */
.submenu-group.has-active-child .submenu-group-header {
    color: rgba(255, 255, 255, 0.95);
}

.submenu-group.has-active-child .submenu-group-header .submenu-icon {
    color: var(--brand-orange);
    opacity: 1;
}

/* Responsive para submenús */
@media (max-width: 768px) {
    .submenu-step {
        padding: 0.4375rem 0.5rem 0.4375rem 1rem;
    }

    .submenu-group-header {
        padding: 0.5rem 0.5rem 0.5rem 1rem;
    }
}

/* ========================================
   LIGHTBOX PARA IMÁGENES
   ======================================== */

/* Solo el modal lightbox - sin afectar imágenes del contenido */
#image-lightbox {
    animation: fadeIn 0.2s ease-out;
}

#image-lightbox img {
    animation: zoomIn 0.3s ease-out;
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Imágenes clickeables - clase específica */
img.lightbox-enabled {
    cursor: pointer;
}

img.lightbox-enabled:hover {
    opacity: 0.95;
}

/* ========================================
   IMÁGENES DE DIAGRAMAS EN MÓDULOS
   ======================================== */

/* Limitar tamaño de imágenes de diagramas en M2-M7 */
[data-module-id="m2-design-patterns"] .bg-neutral-50 img,
[data-module-id="m3-arch-patterns"] .bg-neutral-50 img,
[data-module-id="m4-diagrams"] .bg-neutral-50 img,
[data-module-id="m5-evaluation"] .bg-neutral-50 img,
[data-module-id="m6-soft-skills"] .bg-neutral-50 img,
[data-module-id="m7-modern-arch"] .bg-neutral-50 img {
    max-width: 450px;
    max-height: 350px;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-module-id="m2-design-patterns"] .bg-neutral-50 img:hover,
[data-module-id="m3-arch-patterns"] .bg-neutral-50 img:hover,
[data-module-id="m4-diagrams"] .bg-neutral-50 img:hover,
[data-module-id="m5-evaluation"] .bg-neutral-50 img:hover,
[data-module-id="m6-soft-skills"] .bg-neutral-50 img:hover,
[data-module-id="m7-modern-arch"] .bg-neutral-50 img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Texto indicador de clic para ampliar - contenedores con imágenes */
[data-module-id="m2-design-patterns"] .bg-neutral-50:has(img),
[data-module-id="m3-arch-patterns"] .bg-neutral-50:has(img),
[data-module-id="m4-diagrams"] .bg-neutral-50:has(img),
[data-module-id="m5-evaluation"] .bg-neutral-50:has(img),
[data-module-id="m6-soft-skills"] .bg-neutral-50:has(img),
[data-module-id="m7-modern-arch"] .bg-neutral-50:has(img) {
    position: relative;
}

[data-module-id="m2-design-patterns"] .bg-neutral-50:has(img)::after,
[data-module-id="m3-arch-patterns"] .bg-neutral-50:has(img)::after,
[data-module-id="m4-diagrams"] .bg-neutral-50:has(img)::after,
[data-module-id="m5-evaluation"] .bg-neutral-50:has(img)::after,
[data-module-id="m6-soft-skills"] .bg-neutral-50:has(img)::after,
[data-module-id="m7-modern-arch"] .bg-neutral-50:has(img)::after {
    content: "Clic para ampliar";
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Imágenes en flex justify-center (M5, M7) */
[data-module-id="m5-evaluation"] .flex.justify-center img,
[data-module-id="m7-modern-arch"] .flex.justify-center img {
    max-width: 450px;
    max-height: 350px;
    width: auto;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-module-id="m5-evaluation"] .flex.justify-center img:hover,
[data-module-id="m7-modern-arch"] .flex.justify-center img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Imágenes en cards de M7 */
[data-module-id="m7-modern-arch"] .bg-white img:not(.no-lightbox) {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-module-id="m7-modern-arch"] .bg-white img:not(.no-lightbox):hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
