/* =========================================
   NAHUI STUDIO PRO - CYBERPUNK THEME
   ========================================= */

/* 1. FUENTES Y VARIABLES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    /* Tu Paleta Pro */
    --bg-deep: #030014;
    --primary: #7928CA;
    --secondary: #FF0080;
    --cyan: #3400df; /* Azul profundo eléctrico */
    --neon-blue: #4c00ff; /* Agregué este para brillos claros */
    --text-main: #ffffff;
    --text-dim: #8892b0;
    
    /* Vidrio Pro */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --header-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Fondo sutil tipo galaxia */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(121, 40, 202, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(52, 0, 223, 0.15) 0%, transparent 40%);
}

/* =========================================
   2. BARRA SUPERIOR (NAVBAR)
   ========================================= */
.studio-nav {
    height: var(--header-height);
    background: rgba(3, 0, 20, 0.6); /* Semi transparente */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10PX 1.5rem;
    position: relative;
    z-index: 50;
}

/* Lado Izquierdo */
.nav-left { display: flex; align-items: center; gap: 20px; }

.btn-back {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 8px;
}
.btn-back:hover { 
    color: white; 
    background: var(--glass);
}

.project-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.project-name { 
    font-family: var(--font-display);
    font-weight: 700; 
    font-size: 1.1rem;
    background: linear-gradient(90deg, #fff, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ✨ ESTABILIZADOR DEL BOTÓN DE GUARDADO ✨ */
.save-status {
    display: inline-flex !important; /* Siempre está en modo flex */
    align-items: center;
    justify-content: flex-start; /* Alinea el texto a la izquierda para que no brinque */
    gap: 5px;
    width: 110px; /* 🔥 EL TRUCO: Reserva el espacio permanentemente */
    opacity: 0; /* Lo hace invisible sin quitarle su espacio */
    visibility: hidden; /* Evita que el usuario le dé clic por accidente */
    transition: opacity 0.3s ease-in-out; /* Aparición suave y elegante */
    white-space: nowrap; /* Evita que el texto se rompa en dos líneas */
}

/* Cuando el JS le agrega la clase .show, solo se hace visible suavemente */
.save-status.show {
    opacity: 1;
    visibility: visible;
}

/* Lado Derecho (Botones Pro) */
.nav-right { display: flex; align-items: center; gap: 12px; }

.btn-action {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-body);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action:hover {
    background: var(--glass-hover);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* Botón Primary (Degradado Potente) */
.btn-action.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(121, 40, 202, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-action.primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
    transform: skewX(-20deg);
}

.btn-action.primary:hover {
    box-shadow: 0 6px 20px rgba(255, 0, 128, 0.5);
    transform: translateY(-1px);
}
.btn-action.primary:hover::before { left: 100%; }

/* =========================================
   3. LAYOUT PRINCIPAL
   ========================================= */
.main-container {
    display: flex;
    flex: 1; 
    height: calc(100vh - var(--header-height));
    position: relative;
}

/* SIDEBAR (Explorador) */
.sidebar-files {
    width: 260px;
    background: rgba(3, 0, 20, 0.4); /* Casi transparente */
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.sidebar-header {
    padding: 15px 20px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-actions button {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    padding: 4px;
    border-radius: 4px;
}
.sidebar-actions button:hover { 
    color: var(--neon-blue); 
    background: var(--glass); 
}

/* =========================================
   TREE VIEW (ESTILO VS CODE)
   ========================================= */
.file-tree {
    flex: 1;
    overflow-y: auto;
    padding-top: 5px;
    font-family: 'Inter', sans-serif;
}

/* El Contenedor de Hijos (La magia de la indentación) */
.folder-children {
    padding-left: 12px; /* Indentación por nivel */
    border-left: 1px solid rgba(255, 255, 255, 0.05); /* Línea guía sutil */
    margin-left: 7px;
    display: none; /* Oculto por defecto (Colapsado) */
}
.folder-children.open {
    display: block; /* Mostrar cuando está abierto */
}

/* Items (Carpetas y Archivos) */
.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dim);
    border-radius: 4px;
    transition: all 0.1s ease;
    user-select: none; /* Que no se seleccione el texto al dar doble clic */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tree-item.active {
    background: rgba(0, 223, 216, 0.1);
    color: var(--neon-blue);
    font-weight: 500;
}

/* Iconos específicos */
.tree-arrow {
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform 0.2s;
    width: 14px;
    text-align: center;
    display: inline-block;
}

.folder-open > .tree-item > .tree-arrow {
    transform: rotate(90deg); /* Flechita gira */
}

.file-icon {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RAÍZ DEL PROYECTO (TEXTO EN NEGRITA) */
.project-root-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: white;
    padding: 10px 15px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   ARREGLO DE COLAPSO Y ÁRBOL
   ========================================= */

/* Por defecto, los hijos de una carpeta están OCULTOS */
.folder-children {
    display: none;
    padding-left: 14px;
    border-left: 1px solid var(--glass-border);
    margin-left: 6px;
}

/* Cuando JS le pone la clase 'open', se MUESTRAN */
.folder-children.open {
    display: block;
    animation: slideDown 0.2s ease-out;
}

/* Animación de la flechita */
.tree-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    margin-right: 5px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Cuando la carpeta está abierta, la flecha gira 90 grados */
.folder-open > .tree-item > .tree-arrow {
    transform: rotate(90deg);
    color: var(--neon-blue);
}

/* Animación suave al abrir */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Carpeta donde se creará el próximo archivo (Foco) */
.folder-wrapper.focused > .tree-item {
    background: rgba(0, 223, 216, 0.15); /* Verde Neón suave */
    border: 1px solid rgba(0, 223, 216, 0.3);
    color: white;
}

/* Ajuste visual para que se vea bien */
.folder-wrapper.focused > .tree-item .ph-folder {
    color: var(--neon-blue) !important;
}
/* =========================================
   4. EDITOR AREA (MONACO)
   ========================================= */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0b1a; /* Fondo sólido oscuro para que Monaco resalte */
    position: relative;
}

/* Pestañas (Tabs) */
.editor-tabs {
    height: 0px;
    background: #030014; /* Match con header */
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--glass-border);
}

.tab {
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    border-right: 1px solid var(--glass-border);
    background: transparent;
    transition: 0.2s;
    position: relative;
}

.tab:hover { background: var(--glass); color: white; }

.tab.active { 
    background: #0d0b1a; /* Match con editor area bg */
    color: white; 
}
.tab.active::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.tab-close { 
    font-size: 0.8rem; 
    opacity: 0.5; 
    border-radius: 50%;
    padding: 2px;
}
.tab-close:hover { opacity: 1; background: rgba(255,0,0,0.2); color: #ff5f5f; }

#monaco-container {
    flex: 1; 
    width: 100%;
    height: 100%;
}

/* =========================================
   5. MODALES Y EXTRAS
   ========================================= */
.modal-overlay {
    background: rgba(3, 0, 20, 0.85); /* Más oscuro */
    backdrop-filter: blur(8px);
}

.modal-box.media-box {
    background: #0a0815;
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 50px rgba(121, 40, 202, 0.2);
}

.modal-header h3 {
    font-family: var(--font-display);
    color: white;
}

.drop-zone {
    background: rgba(255,255,255,0.02);
    border: 2px dashed var(--glass-border);
    color: var(--text-dim);
}
.drop-zone:hover {
    border-color: var(--secondary);
    background: rgba(255, 0, 128, 0.05);
    color: white;
}

/* SCROLLBAR CYBERPUNK */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =========================================
   CORRECCIÓN URGENTE: MODALES
   ========================================= */

.modal-overlay {
    /* Esto faltaba para que flote encima de todo */
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    
    /* Estética */
    background: rgba(3, 0, 20, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999; /* ¡Encima de todo! */
    
    /* Lógica de Centrado y Ocultamiento */
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
}

/* Cuando JS agrega la clase 'open', esto lo muestra */
.modal-overlay.open {
    display: flex !important;
}

/* Aseguramos que la caja del modal se vea bien */
.modal-box.media-box {
    width: 800px;
    height: 600px;
    background: #0a0815;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(121, 40, 202, 0.3);
    display: flex;
    flex-direction: column;
    position: relative; /* Para que el z-index funcione */
}

/* =========================================
   MODAL DE RECURSOS (DISEÑO PREMIUM)
   ========================================= */

/* 1. EL FONDO (Overlay) */
.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(3, 0, 15, 0.9); /* Más oscuro */
    backdrop-filter: blur(12px); /* Blur intenso */
    z-index: 9999;
    
    /* Centrado Flexbox */
    display: none; 
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Estado Abierto */
.modal-overlay.open {
    display: flex;
    opacity: 1;
}

/* 2. LA CAJA DEL MODAL */
.modal-box.media-box {
    width: 850px;
    height: 650px;
    background: #0a0812; /* Casi negro */
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(121, 40, 202, 0.15); /* Resplandor Púrpura sutil */
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-box.media-box {
    transform: scale(1); /* Efecto Pop al abrir */
}

/* 3. CABECERA DEL MODAL */
.modal-header {
    height: 70px;
    padding: 0 30px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: white;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botón Cerrar (X) */
.close-modal {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px; 
    height: 40px;
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255, 0, 128, 0.1);
    color: var(--secondary); /* Rosa neón */
    transform: rotate(90deg); /* Giro cool */
}

/* 4. ZONA DE ARRASTRAR (DROP ZONE) */
.drop-zone {
    margin: 30px;
    height: 180px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone i {
    font-size: 3rem;
    color: var(--text-dim);
    margin-bottom: 15px;
    transition: 0.3s;
}

.drop-zone p {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.drop-zone small {
    color: var(--text-dim);
    margin-top: 5px;
}

/* Efecto Hover en Drop Zone */
.drop-zone:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 223, 216, 0.03);
    box-shadow: inset 0 0 20px rgba(0, 223, 216, 0.05);
}

.drop-zone:hover i {
    color: var(--neon-blue);
    transform: translateY(-5px);
}

/* 5. GRID DE IMÁGENES (Donde aparecen) */
.media-grid {
    flex: 1; /* Ocupa el resto del espacio */
    padding: 0 30px 30px 30px;
    overflow-y: auto;
    
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Tarjetas responsivas */
    gap: 20px;
    align-content: start;
}

/* Tarjeta de Imagen Individual */
.media-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    
}

.media-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.media-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
}

.media-item-name {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-item:hover .media-item-name {
    color: white;
}

/* =========================================
   INPUT INLINE (ESTILO VS CODE)
   ========================================= */
.temp-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px; /* Un poco más ajustado */
    background: rgba(0, 223, 216, 0.1); /* Fondo sutil para indicar edición */
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    margin: 2px 0;
}

.temp-input-box {
    background: transparent;
    border: none;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

.temp-input-box::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* =========================================
   MENÚ CONTEXTUAL (RIGHT CLICK)
   ========================================= */
.context-menu {
    display: none; /* Oculto por defecto */
    position: absolute;
    z-index: 10000;
    background: #0f0c1d;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    width: 180px;
    overflow: hidden;
    animation: fadeIn 0.1s ease-out;
}

.context-menu.visible {
    display: block;
}

.context-menu ul {
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.context-menu li {
    padding: 8px 15px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.context-menu li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.context-menu li.danger:hover {
    background: rgba(255, 0, 128, 0.15); /* Rojo al pasar el mouse */
    color: #ff5f5f;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}



/* =========================================
   🎛️ CUSTOM MODEL SELECTOR (PREMIUM UI)
   ========================================= */

.custom-model-selector {
    position: relative; /* Para posicionar el menú absoluto */
    z-index: 10000;
}

/* 1. EL BOTÓN VISIBLE (TRIGGER) */
.selected-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.selected-trigger:hover, .selected-trigger.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.selected-trigger i { font-size: 1.1rem; }
.selected-trigger span { font-weight: 600; font-size: 0.9rem; margin-right: 5px; }
.selected-trigger .arrow-icon { font-size: 0.8rem; opacity: 0.5; transition: transform 0.3s; }

/* Rotar flecha cuando está abierto */
.selected-trigger.active .arrow-icon { transform: rotate(180deg); color: var(--secondary); }


/* 2. EL MENÚ FLOTANTE (DROPDOWN) */
.model-options-menu {
    position: absolute;
    bottom: 120%; /* Flota ARRIBA del botón */
    left: 0;
    width: 320px; /* Ancho cómodo para texto */
    background: #0a0a12;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    
    /* Animación de entrada */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.model-options-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* 3. CADA OPCIÓN (ITEM) */
.model-option {
    display: flex;
    align-items: flex-start; /* Alinear arriba por si el texto es largo */
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.model-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Estado Activo (Seleccionado) */
.model-option.selected {
    background: rgba(121, 40, 202, 0.1); /* Fondo morado sutil */
    border-color: rgba(121, 40, 202, 0.3);
}

/* Icono Grande */
.opt-icon {
    background: rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}
.model-option:hover .opt-icon { color: white; background: rgba(255, 255, 255, 0.2); }
.model-option.selected .opt-icon { color: var(--secondary); background: rgba(255, 0, 128, 0.1); }

/* Texto Rico */
.opt-text { flex: 1; }

.opt-text h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: white;
    font-weight: 700;
}

.opt-text p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.3;
}

/* Icono Check (Solo visible si seleccionado) */
.opt-check {
    color: var(--secondary);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}
.model-option.selected .opt-check { opacity: 1; transform: scale(1); }

.model-badge i { font-size: 1rem; }
.model-badge .arrow-icon { font-size: 0.7rem; opacity: 0.5; }

/* 5. BOTÓN DE LANZAMIENTO */
.btn-launch {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 0, 128, 0.2);
}

.btn-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 0, 128, 0.4);
    filter: brightness(1.1);
}

.btn-launch:active {
    transform: translateY(1px);
}

/* 6. LOADER (Badge flotante) */
.ai-status-badge {
    position: absolute;
    top: -40px; /* Flota arriba de la cápsula */
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease-out;
}

.loader-dot {
    width: 8px;
    height: 8px;
    background: var(--cyan);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* =========================================
   6. ESPACIO DE TRABAJO VISUAL (IFRAME)
   ========================================= */
#visual-workspace {
    background: #ffffff; /* Fondo blanco puro para que la web se vea real */
    position: relative;
}

#visual-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

/* =========================================
   7. BURBUJA FLOTANTE IA (CHAT MODE)
   ========================================= */
body.nahui-no-ai #ai-bubble-trigger,
body.nahui-no-ai #ai-backdrop,
body.nahui-no-ai #ai-command-center {
    display: none !important;
}

.ai-bubble-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 3, 116, 0.44);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-bubble-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(255, 0, 128, 0.6);
}



.close-ai-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 10;
}

.close-ai-btn:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

@keyframes popInBubble {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =========================================
   6. ESPACIO DE TRABAJO VISUAL (IFRAME)
   ========================================= */
#visual-workspace {
    background: #ffffff; /* Fondo blanco puro para que la web se vea real */
    position: relative;
}

#visual-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

/* =========================================
   🤖 7. CHAT DE IA PREMIUM (GLASSMORPHISM)
   ========================================= */

/* --- EL BOTÓN FLOTANTE (LA BURBUJA) --- */
.ai-bubble-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-bubble-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(255, 0, 128, 0.6);
}

/* Cuando JS le pone esta clase, se encoge y desaparece suavemente */
.ai-bubble-btn.hide-bubble {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
}

/* --- ✨ EL TELÓN AZUL DIFUMINADO ✨ --- */
.ai-backdrop-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Azul muy oscuro para contraste */
    background: rgb(3 1 19 / 88%); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
.ai-backdrop-overlay.show-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- ✨ LA CÁPSULA GLASS ROSADA (CENTRADA Y GIGANTE) ✨ --- */
.ai-capsule {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 975px;
    max-width: 95vw;
    height: 95vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    background: rgba(223, 0, 149, 0.05);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(223, 0, 149, 0.767);
    box-shadow: 0 30px 180px rgba(143, 2, 93, 0.574), inset 0 0 20px rgba(223, 0, 149, 0.08);
    border-radius: 24px;
    padding: 40px 10px 15px 10px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -40%) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Cuando se abre, se va al centro exacto */
.ai-capsule.show-capsule {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* --- BOTÓN CERRAR (LA X) --- */
.close-ai-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 10;
}
.close-ai-btn:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

/* --- ✨ HISTORIAL DE CHAT ✨ --- */
.ai-chat-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 5px;
    margin-bottom: 15px;
}

.ai-chat-history::-webkit-scrollbar { width: 6px; }
.ai-chat-history::-webkit-scrollbar-track { background: transparent; }
.ai-chat-history::-webkit-scrollbar-thumb { background: rgba(223, 0, 149, 0.3); border-radius: 10px; }
.ai-chat-history::-webkit-scrollbar-thumb:hover { background: rgba(223, 0, 149, 0.6); }

.ai-chat-welcome {
    text-align: center;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}
.ai-chat-welcome i {
    font-size: 2.5rem;
    color: rgba(223, 0, 149, 0.5);
    animation: pulse 2s infinite;
}

/* --- ✨ DISEÑO DE BURBUJAS DE CHAT ✨ --- */
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    animation: bubble-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 223, 216, 0.15), rgba(0, 223, 216, 0.05));
    border: 1px solid rgba(0, 223, 216, 0.3);
    border-bottom-right-radius: 4px;
    color: #fff;
}

.bubble-ai {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(223, 0, 149, 0.2), rgba(223, 0, 149, 0.05));
    border: 1px solid rgba(223, 0, 149, 0.4);
    border-bottom-left-radius: 4px;
    color: #fff;
}

.bubble-ai pre {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #00DFD8;
}

/* --- ✨ INDICADOR DE ANÁLISIS PRO (Reemplaza los 3 puntitos) ✨ --- */
.ai-analyzing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--primary, #00DFD8);
}

.ai-analyzing-icon {
    font-size: 1.5rem;
    color: #ff0080; /* Rosa neón de Nahui */
    animation: atom-spin 2s linear infinite;
}

.ai-analyzing-text {
    position: relative;
    display: inline-block;
    color: #fff;
    opacity: 0.9;
}

/* Efecto de puntos suspensivos que se escriben solos */
.ai-analyzing-text::after {
    content: '';
    animation: typing-dots 1.5s infinite steps(4, end);
}

/* El átomo gira y palpita con brillo */
@keyframes atom-spin {
    0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 5px rgba(255, 0, 128, 0.4)); }
    50% { transform: rotate(180deg) scale(1.2); filter: drop-shadow(0 0 15px rgba(255, 0, 128, 0.9)); }
    100% { transform: rotate(360deg) scale(1); filter: drop-shadow(0 0 5px rgba(255, 0, 128, 0.4)); }
}

@keyframes typing-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

@keyframes bubble-pop {
    0% { opacity: 0; transform: translateY(15px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes typing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 0.4; }
    100% { transform: scale(1); opacity: 0.8; }
}


/* --- ✨ ZONA INFERIOR (INPUT + CONTROLES) ✨ --- */
.ai-chat-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08); /* La línea delgada y elegante */
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
}

.ai-input-zone {
    width: 100%;
}

#ai-prompt-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none; /* Quitamos la esquinita fea de arrastrar */
    outline: none;
    max-height: 150px;
    overflow-y: auto;
    padding: 0 10px; /* Alineación perfecta con el resto del chat */
}

/* Color del texto de "Describe tu idea..." */
#ai-prompt-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

/* Scrollbar minimalista para cuando el texto sea muy largo */
#ai-prompt-input::-webkit-scrollbar { width: 4px; }
#ai-prompt-input::-webkit-scrollbar-track { background: transparent; }
#ai-prompt-input::-webkit-scrollbar-thumb { background: rgba(223, 0, 149, 0.3); border-radius: 4px; }

/* Acomodamos la barra de controles para que fluya natural */
.ai-control-bar {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 10px;
}





/* =========================================
   📱 SIMULADOR DE DISPOSITIVOS (Fase 2)
   ========================================= */
.nav-center {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.device-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.device-btn.active {
    color: var(--neon-blue);
    background: rgba(0, 223, 216, 0.1);
    border: 1px solid rgba(0, 223, 216, 0.3);
    box-shadow: 0 0 10px rgba(0, 223, 216, 0.2);
}

/* Modificamos el workspace visual para que el Iframe se pueda centrar */
#visual-workspace {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Para que quede pegado arriba */
    background: #0d0b1a !important; /* Fondo oscuro para que resalte la web blanca */
    overflow-y: hidden;
    padding-top: 0;
    transition: padding 0.4s ease;
}

#visual-iframe {
    background: #ffffff;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.4s;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    height: 100%;
}

/* =========================================
   🎛️ PANEL DE EDICIÓN FLOTANTE (Fase 4)
   ========================================= */
.floating-panel {
    position: fixed;
    top: 100px;
    right: 30px; /* Posición inicial */
    width: 520px;
    min-width: 260px; /* No se puede hacer más angosto que esto */
    max-width: 600px; /* Límite de ancho */
    height: 450px;
    min-height: 200px;
    background: rgba(8, 6, 18, 0.85); /* Cristal Oscuro */
    backdrop-filter: blur(20px);
    border: 1px solid var(--cyan);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(41, 36, 46, 0.6), 0 0 20px rgba(0, 223, 216, 0.1);
    z-index: 10001; /* Por encima de todo */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Necesario para que el resize funcione bien */
    transition: opacity 0.2s ease;
}

/* Cabecera para Arrastrar */
.panel-header {
    height: 45px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    cursor: grab; /* Indica que se puede agarrar */
    user-select: none;
}
.panel-header:active { cursor: grabbing; } /* Cambia el cursor al arrastrar */

.panel-title { color: white; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--neon-blue); font-size: 1rem; }

/* Botón Cerrar (X) estilo Cyberpunk consistente */
.btn-close-panel {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.2rem; /* Un pelín más grande para que se note el giro */
    transition: all 0.3s ease; /* Transición suave para el giro */
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Redondito para que gire sobre su eje */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-panel:hover {
    color: var(--secondary); /* Rosa neón consistente */
    background: rgba(255, 0, 128, 0.1); /* Fondo sutil al pasar el mouse */
    transform: rotate(90deg); /* ✨ EL GIRO MÁGICO ✨ */
}

/* Pestañas */
.panel-tabs { display: flex; border-bottom: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); }
.panel-tab {
    flex: 1; background: transparent; border: none; color: var(--text-dim);
    padding: 10px 0; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: 0.2s;
    border-bottom: 2px solid transparent;
}
.panel-tab:hover { color: white; background: rgba(255,255,255,0.02); }
.panel-tab.active { color: var(--neon-blue); border-bottom-color: var(--neon-blue); background: rgba(0, 223, 216, 0.05); }

/* Cuerpo del Panel */
.panel-body { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); text-align: center; gap: 10px; opacity: 0.5; }
.empty-state i { font-size: 2.5rem; color: var(--neon-blue); }

/* ✨ BOTÓN DE REDIMENSIONAMIENTO CUSTOM ✨ */
.custom-resizer {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 35px;
    background: rgba(0, 223, 216, 0.1);
    border-top-left-radius: 16px; /* Curva hacia adentro */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize; /* Cursor de flecha diagonal */
    color: #fff;
    font-size: 1.2rem;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}

.custom-resizer:hover, .custom-resizer.active {
    background: var(--neon-blue);
    color: #000;
    box-shadow: -5px -5px 15px rgba(0, 223, 216, 0.2);
}

/* =========================================
   🎛️ CAMPOS DE EDICIÓN DEL PANEL
   ========================================= */
.editor-field {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-field label {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

.editor-input:focus {
    border-color: var(--neon-blue);
    background: rgba(0, 223, 216, 0.05);
    box-shadow: 0 0 10px rgba(0, 223, 216, 0.1);
}

.editor-input.textarea {
    resize: vertical;
    min-height: 80px;
}

.close-settings-modal:hover {
    color: var(--secondary) !important;
    transform: rotate(90deg);
}

/* =========================================
   🔥 CORRECCIÓN: MODALES PREMIUM Y Z-INDEX
   ========================================= */

/* 1. UNIFICACIÓN PREMIUM PARA TODOS LOS MODALES */
/* Al aplicarlo a .modal-box general, todos heredan el diseño Cyberpunk */
.modal-box {
    background: #0a0812 !important; /* Casi negro */
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px !important;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(121, 40, 202, 0.15) !important; /* Resplandor Púrpura */
    overflow: hidden !important; /* Para que las esquinas no se salgan */
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-box {
    transform: scale(1) !important; /* Efecto pop al abrir */
}

/* 2. JERARQUÍA DE CAPAS (Z-INDEX) */
/* Los modales normales (Ajustes y Nueva Página) van en la capa 10000 */
#modal-site-settings, 
#modal-new-page { 
    z-index: 10000 !important; 
}

/* La Galería de Medios es la REINA y debe ir encima de todo (Capa 10005) */
#modal-media { 
    z-index: 10005 !important; 
}

/* Y los detalles de la imagen (cuando le das clic a una) es el REY absoluto (Capa 10006) */
#modal-media-details { 
    z-index: 10006 !important; 
}

/* =========================================
   🔥 SELECTOR DE ANCLAS PREMIUM (CYBERPUNK)
   ========================================= */
select.editor-input {
    appearance: none; /* Mata el estilo feo de Windows/Mac */
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Flecha Neón personalizada en SVG */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2300DFD8' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px; /* Deja espacio para que el texto no pise la flecha */
    cursor: pointer;
}

/* Estilo oscuro para las opciones desplegables */
select.editor-input option {
    background-color: #0a0812; 
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    padding: 12px;
}

/* --- MAGIA DEL SWITCH WHATSAPP --- */
input:checked + .nahui-switch {
    background-color: var(--primary);
    border-color: var(--primary);
}
input:checked + .nahui-switch .nahui-switch-knob {
    transform: translateX(22px);
    background-color: #000;
}

/* --- MAGIA DE LAS CAJITAS DE DISEÑO --- */
.wa-design-option:hover {
    border-color: var(--neon-blue) !important;
    background: rgba(0, 223, 216, 0.02) !important;
}
.wa-design-option.active {
    border-color: var(--primary) !important;
    background: rgba(0, 223, 216, 0.05) !important;
    box-shadow: inset 0 0 0 1px var(--primary);
}

/* --- MAGIA DE LAS CAJITAS DE DISEÑO (5 Opciones) --- */
.wa-design-option {
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    padding: 12px 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: 0.2s ease-in-out;
}
.wa-design-option:hover {
    border-color: #25D366 !important;
    background: rgba(37, 211, 102, 0.05) !important;
}
.wa-design-option.active {
    border-color: #25D366 !important;
    background: rgba(37, 211, 102, 0.1) !important;
    box-shadow: inset 0 0 0 1px #25D366;
}

/* Diseño bonito para cada mensajito en la lista */
.tooltip-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: white;
}
.tooltip-item-row button {
    background: none;
    border: none;
    color: #ff5f5f;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}
.tooltip-item-row button:hover {
    transform: scale(1.2);
}

.gallery-ghost {
            opacity: 0.4 !important;
            border: 2px dashed var(--primary) !important;
            transform: scale(0.95);
        }

/* --- ✨ VISUALIZADOR DE DESPLIEGUE (GLASS PINK V4) ✨ --- */
.ai-build-progress {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    
    /* 🔮 LA MAGIA DEL CRISTAL INTERNO */
    background: rgba(255, 255, 255, 0.02); /* Súper transparente */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(223, 0, 149, 0.25); /* Borde rosita de Nahui */
    border-radius: 16px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2), inset 0 0 20px rgba(223, 0, 149, 0.05); /* Brillo interno rosa */
}

/* El encabezado de cristal con degradado sutil */
.ai-build-header {
    background: linear-gradient(90deg, rgba(223, 0, 149, 0.1), rgba(0, 223, 216, 0.05));
    padding: 12px 20px;
    border-bottom: 1px solid rgba(223, 0, 149, 0.15); /* Separador rosa */
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
    color: #fff;
}
.ai-build-header i { color: #ff0080; font-size: 1.2rem; filter: drop-shadow(0 0 5px rgba(255,0,128,0.5)); }

/* Contenedor de los pasos */
.ai-build-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.build-step {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px dashed rgba(223, 0, 149, 0.15); /* Rayitas rosas separadoras */
}
.build-step:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* El icono circular (más estilizado) */
.step-icon-box {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    transition: all 0.4s ease;
}

/* Textos */
.step-text { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.step-title { font-size: 0.95rem; font-weight: 600; color: #fff; }
.step-desc { 
    font-size: 0.8rem; 
    color: var(--text-dim); 
    display: block; 
    height: 18px; 
    overflow: hidden;
}

/* --- ESTADOS DE LOS CÍRCULOS --- */
.build-step.pending .step-icon-box { color: rgba(255, 255, 255, 0.2); }

.build-step.building .step-icon-box { 
    background: rgba(0, 223, 216, 0.1);
    border-color: rgba(0, 223, 216, 0.5);
    color: #00DFD8;
    box-shadow: 0 0 15px rgba(0, 223, 216, 0.3);
}
.build-step.building .step-desc { color: #00DFD8; font-family: 'Fira Code', monospace; }

.build-step.done .step-icon-box { 
    background: rgba(39, 201, 63, 0.1); 
    border-color: rgba(39, 201, 63, 0.4);
    color: #27c93f;
    box-shadow: 0 0 10px rgba(39, 201, 63, 0.2);
}
.build-step.done .step-desc { color: #27c93f; }

/* --- ANIMACIONES DEL ÁTOMO Y TEXTOS --- */
.step-atom-spin { animation: step-atom-anim 1.5s linear infinite; }
@keyframes step-atom-anim { 
    0% { transform: rotate(0deg) scale(1); } 
    50% { transform: rotate(180deg) scale(1.25); } 
    100% { transform: rotate(360deg) scale(1); } 
}

.fade-text { animation: textFadeInOut 0.3s ease-in-out; }
@keyframes textFadeInOut { 
    0% { opacity: 0; transform: translateX(-5px); } 
    100% { opacity: 1; transform: translateX(0); } 
}

/* Estado Skipped (Cuando la IA no usa JS) */
.build-step.skipped .step-icon-box { 
    background: rgba(136, 146, 176, 0.1); /* Gris azulado elegante */
    border-color: rgba(136, 146, 176, 0.3);
    color: #8892b0;
}
.build-step.skipped .step-desc { 
    color: #8892b0; 
    font-style: italic; 
}
