:root {
    --primary: #2b5876;
    --secondary: #4e4376;
    --accent: #e74c3c;
    --bg-color: #f0f4f8;
    --text-dark: #2c3e50;
}

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-dark); 
    margin: 0; 
    padding: 20px; 
}

/* Encabezado */
header { 
    background: linear-gradient(135deg, var(--primary), var(--secondary)); 
    color: white; 
    text-align: center; 
    padding: 30px 20px; 
    border-radius: 12px; 
    margin-bottom: 30px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
header h1 { margin: 0; font-size: 2.5em; letter-spacing: 1px; }
header p { margin: 10px 0 0 0; font-size: 1.2em; opacity: 0.9; }

.container { max-width: 1100px; margin: auto; }

/* Pestañas Interactivas */
.tab-buttons { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 30px; 
    flex-wrap: wrap; 
}
.tab-buttons button { 
    background-color: white; 
    color: var(--primary); 
    border: 2px solid var(--primary); 
    padding: 12px 25px; 
    font-size: 16px; 
    font-weight: 600;
    border-radius: 30px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}
.tab-buttons button:hover, .tab-buttons button.active { 
    background-color: var(--primary); 
    color: white; 
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(43, 88, 118, 0.3);
}

/* Contenido de las pestañas */
.tab-content { 
    display: none; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.08); 
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out; 
}
.tab-content.active { display: flex; flex-direction: row; }

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

/* Layout de la Tarjeta (Texto Izquierda / Imagen Derecha) */
.text-section { 
    padding: 40px; 
    flex: 1; 
    border-right: 1px solid #eee;
}
.image-section { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 40px; 
    background-color: #fafcfd;
}
.image-section img { 
    max-width: 100%; 
    max-height: 400px; 
    object-fit: contain; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.diagram-title { 
    color: var(--primary); 
    font-size: 2em; 
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--accent); 
    display: inline-block;
    padding-bottom: 5px; 
}

.info-block { margin-bottom: 20px; line-height: 1.6; }
.tag { 
    display: inline-block;
    background-color: var(--secondary);
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .tab-content.active { flex-direction: column; }
    .text-section { border-right: none; border-bottom: 1px solid #eee; padding: 25px; }
    .image-section { padding: 25px; }
}

/* --- MAGIA PARA EL PDF (Impresión) --- */
@media print {
    body { background-color: white; padding: 0; }
    .tab-buttons { display: none; } /* Oculta los botones */
    .tab-content { 
        display: flex !important; /* Muestra TODOS los diagramas */
        flex-direction: column; 
        box-shadow: none; 
        border: 2px solid #ccc; 
        margin-bottom: 30px;
        page-break-inside: avoid; /* Evita que un diagrama se corte a la mitad de la hoja */
    }
    .text-section { border-right: none; padding: 20px; }
    header { box-shadow: none; }
}