:root {
    /* Paleta de Color Premium Oscura */
    --bg-app: #0A0A0B;
    --bg-sidebar: #131316;
    --bg-card: #1C1C20;
    --border-color: rgba(255,255,255,0.06);
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    
    /* Degradados Oficiales de Aplicaciones */
    --gradient-editio: linear-gradient(135deg, #ff7f70 0%, #f8cc7d 100%);
    --gradient-verta: linear-gradient(135deg, #03e062 0%, #e9f78f 100%);
    --gradient-versum: linear-gradient(135deg, #a409e1 0%, #7babf3 100%);
    --gradient-liveo: linear-gradient(135deg, #ea3fc0 0%, #ff8c87 100%);
    --gradient-distic: linear-gradient(135deg, #2b66ff 0%, #15e0fc 100%);
    
    /* Variable dinámica que cambiará con JS. Por defecto inicia en versum */
    --gradient-brand: var(--gradient-versum);
    --gradient-bar: var(--gradient-brand);
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 90px; /* Ajuste para los iconos nuevos a 50px */
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Satoshi', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden; /* App feel, not website feel */
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ================================= */
/* SIDEBAR (Ahora con funcionalidad de colapsable) */
/* ================================= */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Separa el logo a la izquierda y flecha a la derecha */
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.toggle-arrow {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.toggle-arrow:hover {
    color: var(--text-primary);
}

.sidebar.collapsed .toggle-arrow {
    /* Rota la flecha 180º para mirar hacia fuera (desplegar) */
    transform: rotate(180deg);
}

.logo-container {
    height: 32px;
    display: flex;
    align-items: center;
    overflow: hidden; /* Para poder ocultarlo bien */
}

/* En la versión _black de Nuntia le añadimos la misma lógica de filtros para que no desentone de los iconos */
.nuntia-logo {
    height: 100%;
    /* Truco sin animaciones pesadas: opacity/width */
    transition: opacity 0.2s, max-width 0.3s;
    opacity: 0.9;
    max-width: 150px; /* Tamaño máximo cuando está abierto */
}

.sidebar.collapsed .nuntia-logo {
    opacity: 0;
    max-width: 0;
}

/* Navegación */
.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrado vertical absoluto en toda la barra */
    gap: 2px; /* Más juntos (antes 8px) */
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 14px; /* padding estándar */
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: background-color 0.2s, color 0.2s, padding 0.3s, justify-content 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

/* Cuando se cierra, centramos el item borrando márgenes y justificando */
.sidebar.collapsed .nav-item {
    padding: 8px 0;
    justify-content: center;
}

/* Mostrar los originales SVGs en las medidas correctas */
.nav-icon {
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: margin-right 0.3s ease; /* Transición suave */
}

/* Al estar colapsada, quitamos el margen derecho del icono para el centrado perfecto */
.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.nav-icon img {
    height: 100%;
    /* Efecto Blanco y Gris apagado por defecto */
    filter: grayscale(100%) brightness(1.5) opacity(0.6);
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Contenedor de Textos */
.nav-text {
    display: flex;
    flex-direction: column;
    opacity: 1;
    max-width: 200px; /* para permitir transición de ancho */
    transition: opacity 0.2s, max-width 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

.nav-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-sub {
    font-size: 0.70rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Estados Hover y Active */
.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Al hacer hover o estar activo: quitar filtro gris, mostrar color real */
.nav-item:hover .nav-icon img,
.nav-item.active .nav-icon img {
    filter: grayscale(0%) brightness(1) opacity(1);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Al colapsar, quitamos la "pastilla" de fondo completamente */
.sidebar.collapsed .nav-item:hover,
.sidebar.collapsed .nav-item.active {
    background-color: transparent;
    box-shadow: none;
}

.sidebar-footer {
    padding: 20px 10px;
    border-top: 1px solid var(--border-color);
}


/* ================================= */
/* MAIN CONTENT                      */
/* ================================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-app);
}

.top-nav {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.work-area {
    flex: 1;
    padding: 0 40px 40px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tool-view {
    display: none;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tool-view.active {
    display: flex;
}

/* ================================= */
/* MINIMALIST URL INPUT (Versum)   */
/* ================================= */
.minimal-prompt {
    text-align: center;
    max-width: 600px;
    width: 100%;
    margin-bottom: 40px;
}

.minimal-prompt h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
}

.input-glass-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 8px 8px 8px 24px;
    display: flex;
    align-items: center;
    transition: border-color 0.3s;
}

.input-glass-container:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 15px;
}

.input-glass-container input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
    font-family: inherit;
}

.input-glass-container input::placeholder {
    color: rgba(142, 142, 147, 0.4);
}

.btn-gradient {
    background: var(--gradient-brand);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-gradient:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

.btn-gradient:active {
    transform: scale(0.98);
}


/* ================================= */
/* PROCESS & PROGRESS CARD           */
/* ================================= */
.process-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 600px;
}

.process-card.hidden {
    display: none;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.btn-cancelar {
    background: transparent;
    color: #EF4444; /* Rojo suave */
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-cancelar:hover {
    background: rgba(239, 68, 68, 0.1);
}

.progress-track {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Aquí aplicamos el degradado que pediste para las barras */
.gradient-bar {
    height: 100%;
    background: var(--gradient-brand); /* Cambiado de brand a uno fijo por defecto */
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Clase extra para el degradado dinámico tricolor (azul -> violeta -> lila) */
.gradient-bar.active {
    background: var(--gradient-bar);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: right;
}

/* ================================= */
/* DRAG AND DROP ZONE (Verta Placeholder) */
/* ================================= */
.drag-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.02);
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.drag-drop-zone:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255, 255, 255, 0.4);
}

.drag-drop-zone svg {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.or-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: var(--text-secondary);
}

/* ================================= */
/* LOG EN TIEMPO REAL (Versum)       */
/* ================================= */
.log-container {
    margin-top: 16px;
    max-height: 180px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.log-line {
    padding: 2px 0;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInLog 0.3s ease forwards;
}

.log-line.log-success {
    color: #34D399;
}

.log-line.log-error {
    color: #F87171;
}

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

/* Scrollbar sutil para el log */
.log-container::-webkit-scrollbar {
    width: 4px;
}

.log-container::-webkit-scrollbar-track {
    background: transparent;
}

.log-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
