/**
 * DIBA 2025 - FLEXBOX COMPATIBILITY
 * 
 * Bootstrap 3 no incluye clases de utilidad para Flexbox.
 * Este archivo proporciona clases equivalentes a Bootstrap 4/5 (d-flex, justify-content-*, etc.)
 * pero compatibles con Bootstrap 3 y SIN !important para permitir manipulación por JavaScript.
 * 
 * IMPORTANTE: Sin !important permite:
 * - jQuery .show() / .hide() / .toggle()
 * - ng-show / ng-hide de Angular
 * - Animaciones fadeIn/fadeOut
 * 
 * Fecha: 10 de febrero de 2026
 */

/* ========================================
   DISPLAY FLEX BÁSICO
   ======================================== */

.d-flex {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.d-inline-flex {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
}

/* ========================================
   DIRECCIÓN
   ======================================== */

.flex-row {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}

.flex-row-reverse {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
}

.flex-column {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.flex-column-reverse {
    -webkit-box-orient: vertical;
    -webkit-box-direction: reverse;
    -ms-flex-direction: column-reverse;
    flex-direction: column-reverse;
}

/* ========================================
   JUSTIFY CONTENT
   ======================================== */

.justify-content-start {
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

.justify-content-end {
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
}

.justify-content-center {
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.justify-content-between {
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

.justify-content-around {
    -ms-flex-pack: distribute;
    justify-content: space-around;
}

.justify-content-evenly {
    justify-content: space-evenly;
}

/* ========================================
   ALIGN ITEMS
   ======================================== */

.align-items-start {
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
}

.align-items-end {
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
}

.align-items-center {
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.align-items-baseline {
    -webkit-box-align: baseline;
    -ms-flex-align: baseline;
    align-items: baseline;
}

.align-items-stretch {
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

/* ========================================
   ALIGN SELF
   ======================================== */

.align-self-start {
    -ms-flex-item-align: start;
    align-self: flex-start;
}

.align-self-end {
    -ms-flex-item-align: end;
    align-self: flex-end;
}

.align-self-center {
    -ms-flex-item-align: center;
    align-self: center;
}

.align-self-baseline {
    -ms-flex-item-align: baseline;
    align-self: baseline;
}

.align-self-stretch {
    -ms-flex-item-align: stretch;
    align-self: stretch;
}

/* ========================================
   FLEX WRAP
   ======================================== */

.flex-wrap {
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.flex-nowrap {
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
}

.flex-wrap-reverse {
    -ms-flex-wrap: wrap-reverse;
    flex-wrap: wrap-reverse;
}

/* ========================================
   FLEX GROW Y SHRINK
   ======================================== */

.flex-grow-0 {
    -webkit-box-flex: 0;
    -ms-flex-positive: 0;
    flex-grow: 0;
}

.flex-grow-1 {
    -webkit-box-flex: 1;
    -ms-flex-positive: 1;
    flex-grow: 1;
}

.flex-shrink-0 {
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.flex-shrink-1 {
    -ms-flex-negative: 1;
    flex-shrink: 1;
}

/* ========================================
   ALIGN CONTENT
   ======================================== */

.align-content-start {
    -ms-flex-line-pack: start;
    align-content: flex-start;
}

.align-content-end {
    -ms-flex-line-pack: end;
    align-content: flex-end;
}

.align-content-center {
    -ms-flex-line-pack: center;
    align-content: center;
}

.align-content-between {
    -ms-flex-line-pack: justify;
    align-content: space-between;
}

.align-content-around {
    -ms-flex-line-pack: distribute;
    align-content: space-around;
}

.align-content-stretch {
    -ms-flex-line-pack: stretch;
    align-content: stretch;
}

/* ========================================
   GAP (Flexbox gap - compatibilidad limitada)
   ======================================== */

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

.gap-5 {
    gap: 3rem;
}

/* ========================================
   WIDTH UTILITIES
   ======================================== */

.w-100 {
    width: 100%;
}

.w-75 {
    width: 75%;
}

.w-50 {
    width: 50%;
}

.w-25 {
    width: 25%;
}

.w-auto {
    width: auto;
}

/* ========================================
   NOTAS DE USO
   ======================================== 
   
   Estas clases están diseñadas para ser compatibles con:
   - IE10+ (con prefijos -ms-)
   - Chrome/Safari (con prefijos -webkit-)
   - Firefox moderno
   - Edge
   
   Uso recomendado:
   <div class="d-flex justify-content-between align-items-center">
       <span>Contenido izquierda</span>
       <button>Derecha</button>
   </div>
   
   Compatible con JavaScript:
   $('.d-flex').hide()  // ✅ Funciona
   $('.d-flex').show()  // ✅ Funciona
   $('.d-flex').toggle() // ✅ Funciona
   
   ======================================== */
