/*!
 * Bootstrap 5 Compatibility CSS
 * Mantiene la compatibilidad visual con componentes de Bootstrap 3
 * Palacios Versión 2 - Estandarización Bootstrap 5
 */

/* ========================================
   PANELS (Bootstrap 3) -> CARDS (Bootstrap 5)
   Mantiene la apariencia visual de panels
   ======================================== */

.panel {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.panel-heading {
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    color: #333;
    padding: 10px 15px;
    font-weight: 500;
}

.panel-title {
    margin: 0;
    font-size: 16px;
    color: inherit;
}

.panel-body {
    padding: 15px;
    flex: 1 1 auto;
}

.panel-footer {
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    padding: 10px 15px;
}

/* Panel Variants - Colores específicos */
.panel-primary .panel-heading {
    background-color: #337ab7;
    border-color: #337ab7;
    color: #fff;
}

.panel-primary {
    border-color: #337ab7;
}

.panel-success .panel-heading {
    background-color: #dff0d8;
    border-color: #d6e9c6;
    color: #3c763d;
}

.panel-success {
    border-color: #d6e9c6;
}

.panel-info .panel-heading {
    background-color: #d9edf7;
    border-color: #bce8f1;
    color: #31708f;
}

.panel-info {
    border-color: #bce8f1;
}

.panel-warning .panel-heading {
    background-color: #fcf8e3;
    border-color: #faebcc;
    color: #8a6d3b;
}

.panel-warning {
    border-color: #faebcc;
}

.panel-danger .panel-heading {
    background-color: #f2dede;
    border-color: #ebccd1;
    color: #a94442;
}

.panel-danger {
    border-color: #ebccd1;
}

/* ========================================
   GLYPHICONS REPLACEMENT
   Reemplaza glyphicons con CSS puro o Bootstrap Icons
   ======================================== */

/* Iconos básicos con CSS puro */
.glyphicon {
    font-family: 'Bootstrap Icons', sans-serif;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Si no tienes Bootstrap Icons, usa estos estilos de respaldo */
.glyphicon-edit::before {
    content: "✎";
}

.glyphicon-remove::before {
    content: "✕";
}

.glyphicon-floppy-save::before {
    content: "💾";
}

.glyphicon-trash::before {
    content: "🗑";
}

.glyphicon-plus::before {
    content: "+";
}

.glyphicon-minus::before {
    content: "-";
}

/* ========================================
   WELL COMPONENT
   Mantiene la funcionalidad de wells de Bootstrap 3
   ======================================== */

.well {
    min-height: 20px;
    padding: 19px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
}

.well-lg {
    padding: 24px;
    border-radius: 6px;
}

.well-sm {
    padding: 9px;
    border-radius: 3px;
}

/* ========================================
   FORM GROUPS - Espaciado Bootstrap 3
   ======================================== */

.form-group {
    margin-bottom: 15px;
}

/* ========================================
   INPUT GROUPS ADDON
   Compatibilidad con input-group-addon de Bootstrap 3
   ======================================== */

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.input-group > .input-group-addon:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.input-group > .input-group-addon:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
}

/* ========================================
   LABELS -> BADGES
   Compatibilidad con labels de Bootstrap 3
   ======================================== */

.label {
    display: inline-block;
    padding: .25em .6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
}

.label-default {
    background-color: #777;
}

.label-primary {
    background-color: #337ab7;
}

.label-success {
    background-color: #5cb85c;
}

.label-info {
    background-color: #5bc0de;
}

.label-warning {
    background-color: #f0ad4e;
}

.label-danger {
    background-color: #d9534f;
}

/* ========================================
   UTILITY CLASSES
   Clases de utilidad adicionales para mantener funcionalidad
   ======================================== */

/* Espaciado similar a Bootstrap 3 */
.margin-bottom-20 {
    margin-bottom: 20px !important;
}

.padding-15 {
    padding: 15px !important;
}

/* Centro de contenido */
.center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Texto responsive */
@media (max-width: 767.98px) {
    .panel-heading {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .panel-body {
        padding: 12px;
    }
    
    .well {
        padding: 15px;
    }
}

/* ========================================
   DROPDOWN FIX - Asegurar que funcionen los dropdowns
   ======================================== */

/* Asegurar que los dropdowns funcionen correctamente */
.dropdown-menu {
    z-index: 1050;
}

/* Fix para dropdowns en navbar */
.navbar .dropdown-menu {
    position: absolute;
}

/* Mejorar visibilidad del dropdown toggle */
.dropdown-toggle::after {
    content: "";
    border: none;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

/* ========================================
   NAVBAR HEIGHT & SCHOOL NAME FIX
   Aumentar altura del navbar y ajustar nombre
   ======================================== */

/* Aumentar altura del header */
#header.header {
    height: 92px !important; /* 80px + 15% = 92px */
    min-height: 92px !important;
    padding: 8px 20px !important;
}

/* Ajustar logo y nombre de la escuela */
.logo {
    max-height: 92px !important;
    align-items: center !important;
}

.logo img {
    max-height: 76px !important; /* Aumentado proporcionalmente */
    width: auto !important;
    margin-right: 12px !important;
}

.logo .fs-4 {
    font-size: 1.1rem !important; /* Tamaño más pequeño para que quepa */
    line-height: 1.2 !important;
    max-width: 200px !important;
    word-wrap: break-word !important;
    white-space: normal !important; /* Permitir salto de línea */
    display: flex !important;
    align-items: center !important;
    color: white !important;
    font-weight: 500 !important;
}

/* Search bar removed - CSS not needed */

/* Ajustar la navegación del header */
.header-nav {
    height: 100% !important;
    align-items: center !important;
}

/* Ajustar iconos del navbar para centrar verticalmente */
.header-nav .nav-link {
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ajustar el contenido del sidebar para compensar el header más alto */
.sidebar {
    top: 92px !important; /* Ajustar para el header más alto */
}

/* Ajustar el contenido principal */
main#main {
    margin-top: 92px !important; /* Compensar header más alto */
    margin-left: 300px !important;
    padding: 20px !important;
}

/* Responsive: ajustar para pantallas pequeñas */
@media (max-width: 1199.98px) {
    .logo .fs-4 {
        display: none !important; /* Ocultar nombre en pantallas pequeñas */
    }
    
    main#main {
        margin-left: 0 !important;
    }
}

@media (max-width: 991.98px) {
    #header.header {
        height: 80px !important; /* Altura normal en móviles */
        min-height: 80px !important;
    }
    
    .logo img {
        max-height: 60px !important;
    }
    
    .sidebar {
        top: 80px !important;
    }
    
    main#main {
        margin-top: 80px !important;
    }
}