/* Variables específicos para universidad */
:root {
    --color-primary: var(--bs-primary);
    --color-text: #444;
    --shadow-card: 0 2px 4px rgba(0,0,0,0.1);
    /* Variables para z-index */
    --z-modal: 10000;
    --z-dropdown: 9000;
    --z-filtros: 8000;
    --z-contenido: 1000;
    --z-tooltip: 20000; /* Valor más alto para asegurar que los tooltips estén por encima de todo */
}

/* Estilos generales */
body {
    background-color: #f8f9fa;
    color: var(--color-text);
}

/* Asegurar que los tooltips estén por encima de todo */
.tooltip {
    z-index: var(--z-tooltip) !important;
}

/* Estilo para los tipos de asignatura con tooltip */
.tipo-asignatura {
    cursor: help;
    border-bottom: 1px dotted #666;
    padding: 2px;
}

/* Título de sección */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title h3 {
    margin: 0;
}

.info-icon {
    color: var(--color-primary);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

/* Contenedor principal */
.container-fluid {
    position: relative;
}

/* Filtros - asegurarse que estén por encima de todo */
.row:first-child {
    position: relative;
    z-index: var(--z-filtros);
}

/* Asegurarse que la card de filtros esté por encima */
.row.mb-4:nth-child(2) {
    position: relative;
    z-index: var(--z-filtros);
}

.row.mb-4:nth-child(2) .card {
    position: relative;
    z-index: var(--z-filtros);
}

.filter-group {
    margin-bottom: 1.5rem;
    position: relative;
}

/* Contenedor del dropdown */
.position-relative {
    position: relative;
}

/* Dropdown de búsqueda */
#resultadosBusqueda {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 9999;
}

/* Establecer z-index bajo para todo el contenido */
.card {
    position: relative;
    z-index: var(--z-contenido);
}

/* Específicamente para las cards de gráficos y tabla */
.row.mb-4:nth-child(3) {
    position: relative;
    z-index: var(--z-contenido);
}

.row.mb-4:nth-child(3) .card {
    position: relative;
    z-index: var(--z-contenido);
}

/* Información adicional también por debajo */
.row.mb-2 {
    position: relative;
    z-index: var(--z-contenido);
}

/* Sobrescribir z-index para la card de filtros */
.row.mb-4:nth-child(2) .card {
    z-index: var(--z-filtros);
}

/* Tabla de reconocimientos */
.table th {
    border-top: none;
    background-color: #f8f9fa;
    color: var(--color-primary);
    font-weight: 600;
}

.table td {
    vertical-align: middle;
    color: var(--color-text);
}

.table tr {
    cursor: pointer;
}

.table tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Gráfico */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

canvas {
    max-width: 100%;
}

/* Alerts */
.alert {
    border-radius: 0.375rem;
    border: none;
}

.alert-info {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--color-text);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Elementos de carga */
.loading {
    position: relative;
    min-height: 200px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive específico para universidad */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 767px) {
    .table th, .table td {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    canvas {
        max-height: 280px;
    }
}

@media (max-width: 375px) {
    .chart-container {
        height: 280px;
    }

    canvas {
        max-height: 260px;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    .chart-container {
        height: 250px;
    }

    canvas {
        max-height: 200px;
    }
}

/* Estilos para el dropdown de búsqueda */
#resultadosBusqueda .dropdown-item {
    padding: 0.75rem 1rem;
    white-space: normal;
    word-wrap: break-word;
    font-size: 1rem;
    cursor: pointer;
    color: #212529;
}

#resultadosBusqueda .dropdown-item:hover,
#resultadosBusqueda .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #212529;
}

/* Estilos para el input de búsqueda */
#searchCiclo {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

#searchCiclo:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

/* Estilos para el placeholder */
#searchCiclo::placeholder {
    color: #909599;
    opacity: 1;
}

/* Ocultar el indicador del datalist */
#searchCiclo::-webkit-calendar-picker-indicator {
    display: none;
}

/* Estilos para el datalist */
#ciclosList {
    width: 100%;
    background-color: white;
    font-size: 1.4rem;
    padding: 0.5rem 0;
}

#ciclosList option {
    padding: 1rem;
    color: #212529;
    cursor: pointer;
    font-size: 1.4rem;
    background-color: white;
}

#ciclosList option:hover {
    background-color: #f8f9fa;
}

/* Estilos para modales */
.modal-backdrop {
    z-index: var(--z-modal) !important;
}

.modal {
    z-index: calc(var(--z-modal) + 10) !important;
}

/* Estilos para el filtro de familias */
.familia-filters {
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.btn-familia {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #dee2e6;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    color: #8f959e;
    cursor: pointer;
    padding: 0;
}

.btn-familia i {
    font-size: 1.8rem;
}

.btn-familia:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-familia.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    border-color: #0d6efd;
}

