/* ========================================
   SISTEMA UIE - ESTILOS PRINCIPALES
   Unidad de Integridad y Ética
   ======================================== */

/* Variables de color UIE */
:root {
    --uie-primary: #9d2449;
    --uie-primary-hover: #7a1c38;
    --uie-primary-light: #b8295a;
}

/* ========================================
   TIPOGRAFÍA GLOBAL
   ======================================== */

/* Aplicar fuente Montserrat globalmente */
* {
    font-family: 'Montserrat', sans-serif;
}

/* Estilos para encabezados */
h1, h2, h4, h5, h6 {
    color: var(--uie-primary);
    font-weight: 700;
}

h3 {
    color: white;
    font-weight: 700;
}

/* ========================================
   SOBRESCRIBIR COLORES DE BOOTSTRAP
   ======================================== */

/* Botones primarios */
.btn-primary {
    background-color: var(--uie-primary);
    border-color: var(--uie-primary);
}

.btn-primary:hover {
    background-color: var(--uie-primary-hover);
    border-color: var(--uie-primary-hover);
}

/* Botones outline primarios */
.btn-outline-primary {
    color: var(--uie-primary);
    border-color: var(--uie-primary);
}

.btn-outline-primary:hover {
    background-color: var(--uie-primary);
    border-color: var(--uie-primary);
}

/* Clases de utilidad de color */
.text-primary {
    color: var(--uie-primary) !important;
}

.bg-primary {
    background-color: var(--uie-primary) !important;
}

.card-header.bg-primary {
    background-color: var(--uie-primary) !important;
}

/* Enlaces globales */
a {
    color: var(--uie-primary);
}

a:hover {
    color: var(--uie-primary-hover);
}

/* Alertas personalizadas */
.alert-info {
    background-color: rgba(157, 36, 73, 0.1);
    border-color: rgba(157, 36, 73, 0.2);
    color: var(--uie-primary-hover);
}

/* ========================================
   NAVEGACIÓN
   ======================================== */

/* Centrar navegación cuando no hay logo */
.navbar-nav { align-items: center; }
.navbar-nav > li { padding: 0 0.5rem; }
.uie-header .collapse.navbar-collapse { justify-content: center; }

@media (max-width: 991.98px) {
    .uie-header .collapse.navbar-collapse { justify-content: center; }
}

/* Logo adicional derecho en navbar */
.navbar-right-logo {
    max-height: 60px;
    width: auto;
    display: block;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--uie-primary) !important;
}

.nav-link.active {
    color: var(--uie-primary) !important;
    font-weight: 600;
}

/* ========================================
   CARDS Y COMPONENTES
   ======================================== */

.card {
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
}

/* ========================================
   HERO SECTION (INDEX.HTML)
   ======================================== */

/* Hero section con imagen de fondo y degradado */
.hero-section {
    height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)), url('../img/fnd.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
}

.hero-content .uie-logo-main {
    filter: brightness(0) invert(1);
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
    color: white; /* Excepción para hero section */
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons .btn {
    margin: 0.5rem;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ========================================
   CALENDARIO ZOOM (CAL_ZOOM.HTML)
   ======================================== */

/* Eventos de Zoom en calendario */
.zoom-meeting {
    background-color: var(--uie-primary);
    border: none;
    color: white;
}

.zoom-meeting:hover {
    background-color: var(--uie-primary-hover);
}

/* Cards de reuniones */
.meeting-card {
    border-left: 4px solid var(--uie-primary);
}

.meeting-card.completed {
    border-left-color: #198754;
    opacity: 0.7;
}

.meeting-card.upcoming {
    border-left-color: #fd7e14;
}

/* Botones de Zoom */
.zoom-link {
    background: linear-gradient(135deg, var(--uie-primary) 0%, var(--uie-primary-hover) 100%);
    border: none;
    transition: transform 0.2s ease;
}

.zoom-link:hover {
    transform: scale(1.05);
}

/* Calendario */
#calendar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.fc-event-time {
    font-weight: bold;
}

/* Excepciones para encabezados en contextos específicos */
.card-header h5,
.card-header h6,
.modal-header h5 {
    color: white;
    font-weight: 700;
}

/* ========================================
   UTILIDADES Y HELPERS
   ======================================== */

/* Espaciado para scroll en secciones */
section {
    scroll-margin-top: 80px;
}

/* ================================================
   DATATABLES PERSONALIZACIÓN Y ÁREAS
   ================================================ */

/* Filtros y botones de DataTables */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.dataTables_wrapper .dt-button {
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    margin-right: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.dataTables_wrapper .dt-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Tabla principal del directorio */
table.dataTable {
    width: 100% !important;
    margin: 0 !important;
}

table.dataTable thead th {
    background-color: var(--uie-primary);
    color: white;
    border-bottom: 2px solid var(--uie-secondary);
    font-weight: 600;
    text-align: center;
    padding: 1rem 0.75rem;
}

table.dataTable tbody td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

/* Colores personalizados para áreas */
:root {
    --color-purple: #6f42c1;
    --color-indigo: #6610f2;
    --color-orange: #fd7e14;
    --color-teal: #20c997;
    --color-pink: #e83e8c;
    --color-cyan: #17a2b8;
    --color-lime: #32cd32;
    --color-emerald: #50c878;
    --color-blue: #007bff;
    --color-amber: #ffc107;
}

/* Colores por áreas - Filas de la tabla */
table.dataTable tbody tr.table-primary {
    background-color: rgba(13, 110, 253, 0.15);
    border-left: 4px solid #0d6efd;
}

table.dataTable tbody tr.table-success {
    background-color: rgba(25, 135, 84, 0.15);
    border-left: 4px solid #198754;
}

table.dataTable tbody tr.table-info {
    background-color: rgba(13, 202, 240, 0.15);
    border-left: 4px solid #0dcaf0;
}

table.dataTable tbody tr.table-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
}

table.dataTable tbody tr.table-secondary {
    background-color: rgba(108, 117, 125, 0.15);
    border-left: 4px solid #6c757d;
}

table.dataTable tbody tr.table-dark {
    background-color: rgba(33, 37, 41, 0.15);
    border-left: 4px solid #212529;
}

table.dataTable tbody tr.table-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-left: 4px solid #dc3545;
}

table.dataTable tbody tr.table-purple {
    background-color: rgba(111, 66, 193, 0.15);
    border-left: 4px solid var(--color-purple);
}

table.dataTable tbody tr.table-indigo {
    background-color: rgba(102, 16, 242, 0.15);
    border-left: 4px solid var(--color-indigo);
}

table.dataTable tbody tr.table-orange {
    background-color: rgba(253, 126, 20, 0.15);
    border-left: 4px solid var(--color-orange);
}

table.dataTable tbody tr.table-teal {
    background-color: rgba(32, 201, 151, 0.15);
    border-left: 4px solid var(--color-teal);
}

table.dataTable tbody tr.table-pink {
    background-color: rgba(232, 62, 140, 0.15);
    border-left: 4px solid var(--color-pink);
}

table.dataTable tbody tr.table-cyan {
    background-color: rgba(23, 162, 184, 0.15);
    border-left: 4px solid var(--color-cyan);
}

table.dataTable tbody tr.table-light {
    background-color: rgba(248, 249, 250, 0.8);
    border-left: 4px solid #f8f9fa;
}

table.dataTable tbody tr.table-lime {
    background-color: rgba(50, 205, 50, 0.15);
    border-left: 4px solid var(--color-lime);
}

table.dataTable tbody tr.table-emerald {
    background-color: rgba(80, 200, 120, 0.15);
    border-left: 4px solid var(--color-emerald);
}

table.dataTable tbody tr.table-blue {
    background-color: rgba(0, 123, 255, 0.15);
    border-left: 4px solid var(--color-blue);
}

table.dataTable tbody tr.table-amber {
    background-color: rgba(255, 193, 7, 0.15);
    border-left: 4px solid var(--color-amber);
}

/* Efectos hover para todas las filas */
table.dataTable tbody tr:hover {
    background-color: rgba(157, 36, 73, 0.1) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Badges de áreas */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.5em 0.75em;
}

.badge.bg-primary { background-color: #0d6efd !important; }
.badge.bg-success { background-color: #198754 !important; }
.badge.bg-info { background-color: #0dcaf0 !important; }
.badge.bg-warning { background-color: #ffc107 !important; }
.badge.bg-secondary { background-color: #6c757d !important; }
.badge.bg-dark { background-color: #212529 !important; }
.badge.bg-danger { background-color: #dc3545 !important; }
.badge.bg-purple { background-color: var(--color-purple) !important; color: white !important; }
.badge.bg-indigo { background-color: var(--color-indigo) !important; color: white !important; }
.badge.bg-orange { background-color: var(--color-orange) !important; color: white !important; }
.badge.bg-teal { background-color: var(--color-teal) !important; color: white !important; }
.badge.bg-pink { background-color: var(--color-pink) !important; color: white !important; }
.badge.bg-cyan { background-color: var(--color-cyan) !important; }
.badge.bg-light { background-color: #f8f9fa !important; }
.badge.bg-lime { background-color: var(--color-lime) !important; }
.badge.bg-emerald { background-color: var(--color-emerald) !important; color: white !important; }
.badge.bg-blue { background-color: var(--color-blue) !important; color: white !important; }
.badge.bg-amber { background-color: var(--color-amber) !important; }

/* Iconos y enlaces */
.fas.fa-envelope {
    color: var(--uie-primary);
}

a[href^="mailto:"] {
    color: var(--uie-text);
    transition: color 0.3s ease;
}

a[href^="mailto:"]:hover {
    color: var(--uie-primary);
    text-decoration: underline !important;
}

/* Responsive DataTables */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: var(--uie-primary);
}

/* Paginación */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.375rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: var(--uie-primary) !important;
    border-color: var(--uie-primary) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: var(--uie-secondary) !important;
    border-color: var(--uie-secondary) !important;
    color: white !important;
}

/* Información de registros */
.dataTables_wrapper .dataTables_info {
    color: var(--uie-text-light);
    font-weight: 500;
}

/* Búsqueda */
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    transition: border-color 0.3s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--uie-primary);
    box-shadow: 0 0 0 0.2rem rgba(157, 36, 73, 0.25);
}

/* Longitud de página */
.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin: 0 0.5rem;
}

/* Estado de carga */
.dataTables_wrapper .dataTables_processing {
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--uie-primary);
    border-radius: 0.5rem;
    color: var(--uie-primary);
    font-weight: 600;
}

/* Clase personalizada para correos */
.correo {
    font-size: 8pt;
}

/* Iframe sin borde */
.no-border {
    border: 0;
}

/* ========================================
   HEADER Y FOOTER STYLES
   ======================================== */

/* Header personalizado con altura mínima */
.uie-header {
    min-height: 120px;
}

/* Footer con estilo UIE */
.uie-footer {
    background-color: #9d2449;
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

.uie-footer-logo {
    max-height: 80px;
    filter: brightness(0) invert(1);
}

.uie-footer-text {
    color: white;
    margin: 0;
}

/* Headers de cards de servicios */
.service-card-header {
    background-color: #9d2449;
    color: white;
}

/* Texto justificado */
.text-justified {
    text-align: justify;
}

/* Imágenes de misión, visión, objetivo */
.mvo-image {
    width: 400px;
    height: 200px;
    border-radius: 5px;
    object-fit: cover;
}

/* Párrafos de misión, visión, objetivo */
.mvo-text {
    width: 400px;
    margin: 0 auto;
    text-align: justify;
}

/* Logo UIE en index */
.uie-logo-main {
    max-height: 150px;
}

/* Tabla del directorio */
.directorio-table {
    font-size: 0.9rem;
}

.directorio-table th,
.directorio-table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

.directorio-table th:nth-child(1), /* Área */
.directorio-table td:nth-child(1) {
    width: 12% !important;
    max-width: 120px;
    word-wrap: break-word;
}

.directorio-table th:nth-child(2), /* Nombre */
.directorio-table td:nth-child(2) {
    width: 25% !important;
    min-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.directorio-table th:nth-child(3), /* Cargo */
.directorio-table td:nth-child(3) {
    width: 20% !important;
    word-wrap: break-word;
}

.directorio-table th:nth-child(4), /* Extensión */
.directorio-table td:nth-child(4) {
    width: 8% !important;
    max-width: 80px;
    text-align: center;
}

.directorio-table th:nth-child(5), /* Correo */
.directorio-table td:nth-child(5) {
    width: 25% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.directorio-table th:nth-child(6), /* Ubicación */
.directorio-table td:nth-child(6) {
    width: 10% !important;
    font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .directorio-table th:nth-child(2), /* Nombre */
    .directorio-table td:nth-child(2) {
        min-width: 150px;
        white-space: normal;
    }
}

/* Fila de filtros */
.filter-row {
    background-color: #f8f9fa;
}

/* Contenedor oculto */
.hidden {
    display: none;
}

/* Imágenes de servicios */
.services-image {
    width: 500px;
    height: 200px;
    object-fit: cover;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Ajustes para dispositivos móviles */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .hero-buttons .btn {
        margin: 0.25rem;
        padding: 10px 20px;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-section {
        height: 80vh;
    }
}