/* main.css - Estilos para la interfaz de workflow modular - TONO NOCTURNO */

:root {
    --closed-width: 60px;
    --transition-speed: 0.3s;
    --night-bg: #0f172a;
    --night-card: #1e293b;
    --night-text: #e2e8f0;
    --night-border: #334155;
    --night-accent: #475569;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--night-text);
}

.workflow-container {
    display: flex;
    height: calc(100vh - 40px);
    gap: 10px;
    position: relative;
}

.workflow-section {
    background: var(--night-card);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--night-border);
}

/* Estados de las secciones */
.section-closed {
    width: var(--closed-width);
    min-width: var(--closed-width);
    max-width: var(--closed-width);
}

.section-half-open {
    flex: 1;
    min-width: 0;
}

.section-full-open {
    flex: 4;
    min-width: 0;
}

/* Botón de estado */
.section-toggle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all var(--transition-speed);
    z-index: 10;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-closed .section-toggle {
    height: 100%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    justify-content: center;
    padding: 20px 0;
}

.section-half-open .section-toggle,
.section-full-open .section-toggle {
    height: 60px;
    writing-mode: horizontal-tb;
    transform: rotate(0deg);
    justify-content: flex-start;
    padding-left: 70px;
}

.section-toggle:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: scale(1.02);
}

.section-closed .section-toggle:hover {
    transform: scale(1.02) rotate(180deg);
}

/* Icono del botón */
.toggle-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    transition: transform var(--transition-speed);
    color: white;
}

.section-closed .toggle-icon {
    left: 50%;
    top: 20px;
    transform: translateX(-50%) rotate(90deg);
}

.section-half-open .toggle-icon {
    transform: translateY(-50%) rotate(0deg);
}

.section-full-open .toggle-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* Contenido de la sección */
.section-content {
    flex: 1;
    padding: 80px 20px 20px 20px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity var(--transition-speed) 0.1s;
    background: var(--night-card);
}

.section-half-open .section-content,
.section-full-open .section-content {
    opacity: 1;
}

.section-closed .section-content {
    display: none;
}

/* Colores de las secciones - Tono nocturno */
.section-1 {
    border-top: 4px solid #3b82f6;
}

.section-2 {
    border-top: 4px solid #10b981;
}

.section-3 {
    border-top: 4px solid #f59e0b;
}

.section-1 .section-toggle {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.section-2 .section-toggle {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.section-3 .section-toggle {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Contenido específico de cada sección */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--night-border);
}

.section-subtitle {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Estados de la aplicación */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-ready {
    background-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-processing {
    background-color: #f59e0b;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.status-completed {
    background-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.status-error {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
    }
    50% { 
        opacity: 0.7;
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .workflow-container {
        flex-direction: column;
        height: auto;
    }
    
    .section-closed {
        width: 100%;
        height: 60px;
        min-width: 100%;
        max-width: 100%;
    }
    
    .section-closed .section-toggle {
        height: 60px;
        writing-mode: horizontal-tb;
        transform: rotate(0deg);
        padding-left: 70px;
    }
    
    .section-closed .toggle-icon {
        left: 20px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }
}

/* Controles de sección */
.section-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.btn-secondary {
    background: var(--night-accent);
    color: #cbd5e1;
    border: 1px solid var(--night-border);
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(75, 85, 99, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #0da271 0%, #047857 100%);
}

/* Lista de archivos */
.file-list {
    margin-top: 20px;
    border: 1px solid var(--night-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.8);
}

.file-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--night-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.file-item:hover {
    background: rgba(51, 65, 85, 0.5);
    transform: translateX(5px);
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
    color: #e2e8f0;
}

.file-date {
    font-size: 12px;
    color: #94a3b8;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--night-border);
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.file-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

/* Área de texto */
.text-area {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--night-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s;
    background: rgba(15, 23, 42, 0.7);
    color: var(--night-text);
}

.text-area:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.text-area::placeholder {
    color: #64748b;
}

/* Mensajes de estado */
.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--night-border);
    font-size: 14px;
    display: flex;
    align-items: center;
    color: #cbd5e1;
}

/* Utilidades de Tailwind que necesitamos - adaptadas para nocturno */
.mt-4 {
    margin-top: 1rem;
}

.p-4 {
    padding: 1rem;
}

.bg-gray-50 {
    background-color: rgba(15, 23, 42, 0.7);
}

.rounded-lg {
    border-radius: 0.5rem;
}

.border {
    border-width: 1px;
}

.border-gray-200 {
    border-color: var(--night-border);
}

.font-semibold {
    font-weight: 600;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

/* Efectos especiales para el tema nocturno */
.workflow-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

/* Scrollbar personalizado para el tema nocturno */
.section-content::-webkit-scrollbar {
    width: 8px;
}

.section-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.section-content::-webkit-scrollbar-thumb {
    background: var(--night-accent);
    border-radius: 4px;
}

.section-content::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Efectos de brillo en los bordes */
.section-1 {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.section-2 {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.section-3 {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

/* Animación sutil para las secciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.workflow-section {
    animation: fadeIn 0.5s ease-out;
}

/* Estrellas de fondo (efecto decorativo) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 160px 20px, rgba(255, 255, 255, 0.3), transparent);
    background-repeat: repeat;
    z-index: -1;
    opacity: 0.3;
}

/* Efecto de neón para los títulos */
.section-title {
    text-shadow: 0 0 10px rgba(241, 245, 249, 0.3);
}

/* Transiciones suaves para todos los elementos interactivos */
.btn, .file-btn, .section-toggle, .file-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto de profundidad */
.workflow-container {
    perspective: 1000px;
}

.workflow-section {
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.workflow-section:hover {
    transform: translateZ(10px);
}

/* Contenedor de contenido generado */
#generated-content {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--night-border);
    color: #cbd5e1;
}

#generated-content h3 {
    color: #f1f5f9;
}

#content-preview {
    color: #94a3b8;
}

#content-preview ul {
    list-style-type: none;
    padding-left: 0;
}

#content-preview li {
    padding: 4px 0;
    position: relative;
    padding-left: 20px;
}

#content-preview li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #3b82f6;
}

/* Mejoras para el área de contenido generado */
#generated-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Ajustes para mejor legibilidad en modo nocturno */
.section-content h2, 
.section-content h3, 
.section-content h4 {
    color: #f1f5f9;
}

.section-content p, 
.section-content li, 
.section-content span {
    color: #cbd5e1;
}

/* Mejora para los botones de archivo */
.file-btn {
    min-width: 60px;
    text-align: center;
}

/* Ajuste para el contenedor principal en móviles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .workflow-container {
        gap: 8px;
    }
    
    .section-content {
        padding: 70px 15px 15px 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Efecto de carga para estados de procesamiento */
@keyframes loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: loading 1s linear infinite;
    margin-right: 8px;
}

/* Mejora para el textarea en modo oscuro */
.text-area::-webkit-scrollbar {
    width: 6px;
}

.text-area::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 3px;
}

.text-area::-webkit-scrollbar-thumb {
    background: var(--night-accent);
    border-radius: 3px;
}

/* Ajuste final para asegurar consistencia */
*:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Clase para elementos deshabilitados */
.btn:disabled,
.file-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover,
.file-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}