/**
 * ============================================================================
 * WEBOPTIMIZER PRO - TERMINAL Y PROGRESO CSS
 * ============================================================================
 * 
 * DESCRIPCIÓN:
 * Estilos para: área de resultados (terminal), barras de progreso,
 * indicadores de estado SSH, spinner de carga, responsive.
 * 
 * REGLA DE ORO #8: ~200 líneas
 * 
 * @author      WebOptimizer Team
 * @version     1.0.0
 * ============================================================================
 */

/* ============================================
   ÁREA DE RESULTADOS (ESTILO TERMINAL)
   ============================================ */

.results-area {
    background: #0d1117;
    border-radius: var(--radius-md);
    padding: 22px;
    margin-top: 22px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.65;
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid #30363d;
}

/* Scrollbar personalizado para resultados */
.results-area::-webkit-scrollbar { width: 8px; }
.results-area::-webkit-scrollbar-track { background: #0d1117; }
.results-area::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.results-area::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Líneas de resultado */
.result-line {
    margin-bottom: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Colores por tipo de mensaje */
.result-ok { color: #3fb950; }
.result-error { color: #f85149; }
.result-info { color: #58a6ff; }
.result-warn { color: #d29922; }

/* ============================================
   BARRA DE PROGRESO
   ============================================ */

.progress-container {
    margin: 28px 0;
}

.progress-bar {
    height: 10px;
    background: var(--color-bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-info));
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s var(--ease-out);
    width: 0%;
    /* Animación shimmer sutil */
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ============================================
   ESTADO DE CONEXIÓN SSH
   ============================================ */

.connection-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--color-bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border-left: 4px solid var(--color-success);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.connected {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background: var(--color-danger);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

/* ============================================
   SPINNER DE CARGA
   ============================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Contenedor centrado para spinner */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-sm);
}

.loading-text {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* ============================================
   ESTADOS VACÍOS / PLACEHOLDERS
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.empty-state-desc {
    font-size: var(--text-sm);
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   RESPONSIVE / MOBILE FIRST
   ============================================ */

@media (max-width: 1024px) {
    .container { padding: var(--spacing-md); }
    
    .header { padding: var(--spacing-lg); }
    
    .modules-grid { grid-template-columns: 1fr; }
    
    .task-meta {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        margin-top: 10px;
        gap: 8px;
    }
    
    .repair-task { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
    .container { padding: 12px; }
    
    .header {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .header h1 { font-size: var(--text-xl); }
    
    .tabs {
        flex-direction: column;
        gap: 6px;
    }
    
    .tab-btn {
        min-width: auto;
        padding: 14px 18px;
    }
    
    .card { padding: 20px; }
    
    .results-area { max-height: 350px; font-size: var(--text-xs); }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    
    .header h1 { font-size: var(--text-lg); }
    
    .card-title { font-size: var(--text-base); }
    
    .btn { padding: 11px 18px; font-size: var(--text-sm); }
    
    .options-panel { padding: 16px; }
    
    .category-header { flex-direction: column; text-align: center; gap: 8px; }
}

/**
 * ============================================================================
 * FIN DE TERMINAL Y PROGRESO CSS
 * ============================================================================
 */
