/* ============================================================================
 * ESTILOS PARA TARJETAS DE MÓDULOS EXPANDIBLES
 * WebOptimer Pro - Detalles Técnicos con Explicaciones
 * ============================================================================ */

/* Contenedor principal de tarjetas */
#results-remote {
    padding: 10px;
}

.modulo-tarjeta {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 12px;
    margin: 10px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modulo-tarjeta:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.modulo-tarjeta.modulo-ok {
    border-left: 4px solid #10b981;
}

.modulo-tarjeta.modulo-error {
    border-left: 4px solid #ef4444;
}

.modulo-tarjeta.modulo-warn {
    border-left: 4px solid #f59e0b;
}

/* Header de la tarjeta (clickeable) */
.modulo-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    user-select: none;
    transition: background 0.2s;
}

.modulo-header:hover {
    background: linear-gradient(135deg, #f1f5f9, #f8fafc);
}

.modulo-icono {
    font-size: 1.3em;
    margin-right: 12px;
    min-width: 30px;
}

.modulo-nombre {
    flex: 1;
    font-weight: 600;
    font-size: 1.05em;
    color: #1e293b;
}

.modulo-score {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-right: 12px;
}

.modulo-tarjeta.modulo-error .modulo-score {
    background: #ef4444;
}

.toggle-icon {
    color: #64748b;
    font-size: 0.8em;
    transition: transform 0.3s;
}

/* Contenido expandible */
.modulo-contenido {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.modulo-contenido.expandido {
    max-height: 2000px; /* Suficiente para mostrar todo el contenido */
    transition: max-height 0.5s ease-in;
}

.detalle-modulo {
    padding: 20px;
}

/* Secciones dentro del detalle */
.seccion-detalle {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.seccion-detalle:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.seccion-detalle h4 {
    color: #1e293b;
    font-size: 1.1em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtitulo-ok {
    color: #059669 !important;
    font-size: 0.95em !important;
    margin: 12px 0 8px !important;
}

.subtitulo-error {
    color: #dc2626 !important;
    font-size: 0.95em !important;
    margin: 12px 0 8px !important;
}

.subtitulo-warn {
    color: #d97706 !important;
    font-size: 0.95em !important;
    margin: 12px 0 8px !important;
}

/* Explicaciones para profanos */
.explicacion {
    color: #64748b;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 8px 0 12px;
    font-style: italic;
    padding-left: 10px;
    border-left: 3px solid #cbd5e1;
}

.explicacion-celda {
    color: #64748b;
    font-size: 0.85em;
}

.explicacion-inline {
    display: block;
    color: #64748b;
    font-size: 0.85em;
    margin-top: 4px;
    padding-left: 15px;
}

/* Tablas de datos */
.tabla-datos {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.9em;
}

.tabla-datos th,
.tabla-datos td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.tabla-datos th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.tabla-dados tr:hover {
    background: #f8fafc;
}

.tabla-datos code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

/* Listas de checks */
.lista-checks {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.lista-checks li {
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 6px;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
}

.lista-checks li.ok {
    background: #f0fdf4;
    border-left-color: #10b981;
}

.lista-checks li.error {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.lista-checks li.warn {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.lista-checks li.info {
    background: #f0f9ff;
    border-left-color: #3b82f6;
}

/* Lista de sugerencias */
.lista-sugerencias {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.lista-sugerencias li {
    padding: 8px 12px;
    margin: 5px 0;
    background: linear-gradient(90deg, #eff6ff, #ffffff);
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

/* Grid de tecnologías */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.tech-item {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.tech-nombre {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.tech-info {
    display: block;
    font-size: 0.85em;
    color: #64748b;
}

/* Info genérico */
.info-generico {
    color: #64748b;
    font-style: italic;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .modulo-header {
        padding: 12px 15px;
    }
    
    .modulo-nombre {
        font-size: 0.95em;
    }
    
    .detalle-modulo {
        padding: 15px;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    .tabla-datos {
        font-size: 0.85em;
    }
    
    .tabla-datos th,
    .tabla-datos td {
        padding: 8px;
    }
}

/* Animación suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modulo-tarjeta {
    animation: fadeIn 0.3s ease-out;
}
