/* ============================================
   BINAS UTILITIES
   Clases utilitarias para reemplazar estilos inline
   
   📌 Propósito: Eliminar estilos inline de archivos Razor
   📅 Creado: Enero 2025
   🎯 Parte de: FASE 7 - Limpieza de estilos inline
   ============================================ */

/* ==========================================
   FONT SIZE UTILITIES
   Clases de utilidad para tamaños de fuente
   ========================================== */
.fs-xs { font-size: var(--font-size-xs) !important; }
.fs-sm { font-size: var(--font-size-sm) !important; }
.fs-base { font-size: var(--font-size-base) !important; }
.fs-md { font-size: var(--font-size-md) !important; }
.fs-lg { font-size: var(--font-size-lg) !important; }
.fs-xl { font-size: var(--font-size-xl) !important; }
.fs-2xl { font-size: var(--font-size-2xl) !important; }
.fs-3xl { font-size: var(--font-size-3xl) !important; }

/* ==========================================
   LAYOUT & SIZING
   ========================================== */
.binas-scrollable {
    max-height: 80vh;
    min-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.binas-fullheight {
    height: 100vh;
    min-height: 100vh;
}

.binas-max-80vh {
    max-height: 80vh;
}

.binas-min-60vh {
    min-height: 60vh;
}

/* ==========================================
   LEGEND COLOR SWATCHES
   Pequeños cuadrados de color para leyendas de mapas
   ========================================== */
.legend-swatch {
    display: inline-block;
  width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Colores específicos de leyenda */
.legend-swatch-purple {
    background: var(--material-purple);
    opacity: 0.6;
}

.legend-swatch-blue {
    background: #3f51b5;
    opacity: 0.5;
}

.legend-swatch-green {
    background: #4caf50;
    opacity: 0.6;
}

.legend-swatch-red {
    background: #f44336;
    opacity: 0.6;
}

.legend-swatch-orange {
    background: var(--material-orange);
    opacity: 0.6;
}

.legend-swatch-yellow {
    background: var(--color-warning);
    opacity: 0.6;
}

.legend-swatch-teal {
    background: #009688;
    opacity: 0.6;
}

.legend-swatch-indigo {
    background: #3f51b5;
    opacity: 0.6;
}

/* ==========================================
   ICON SIZES & COLORS
   Tamaños estándar para iconos Font Awesome
   ========================================== */
.icon-xs {
    font-size: 12px;
}

.icon-sm {
    font-size: 14px;
}

.icon-md {
    font-size: 16px;
}

.icon-lg {
    font-size: 20px;
}

.icon-xl {
    font-size: 24px;
}

.icon-2xl {
    font-size: 2rem; /* 32px */
}

.icon-3xl {
    font-size: 3rem; /* 48px */
}

/* Special sizes */
.icon-tiny {
    font-size: 0.7rem; /* ~11px */
}

/* Colores de iconos */
.icon-orange {
    color: var(--material-orange);
}

.icon-green {
    color: var(--color-success);
}

.icon-blue {
    color: var(--category-trend);
}

.icon-red {
    color: var(--color-danger);
}

.icon-yellow {
    color: var(--color-warning);
}

.icon-purple {
    color: #6f42c1;
}

.icon-teal {
    color: #20c997;
}

.icon-gray {
    color: var(--text-secondary);
}

.icon-indigo {
    color: var(--palette-indigo);
}

/* ==========================================
   TEXT UTILITIES
   Estilos de texto reutilizables
   ========================================== */
.text-block-small {
    display: block;
 font-size: 0.7rem;
 color: #666;
    font-weight: normal;
    line-height: 1.3;
}

.text-muted-light {
    color: #999;
}

.text-muted-dark {
    color: #555;
}

.text-compact {
    line-height: 1.2;
}

/* ==========================================
   PROGRESS BARS
   Barras de progreso compactas
   ========================================== */
.progress-thin {
    height: 4px;
}

.progress-mini {
    height: 2px;
}

.progress-medium {
    height: 8px;
}

/* ==========================================
   VISIBILITY UTILITIES
   Control de visibilidad
   ========================================== */
/* Bootstrap ya tiene .d-none, pero agregamos alias */
.hidden {
    display: none !important;
}

.invisible {
 visibility: hidden !important;
}

.visible {
    visibility: visible !important;
}

/* ==========================================
   STATS CARDS
 Tarjetas de estadísticas compactas
   ========================================== */
.stats-card-compact {
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--outlook-bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-card-compact .badge {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.stats-card-compact h6 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #666;
}

/* ==========================================
   SPACING UTILITIES
   Espaciados personalizados que complementan Bootstrap
   ========================================== */
.mt-xs {
    margin-top: 0.25rem;
}

.mb-xs {
    margin-bottom: 0.25rem;
}

.p-xs {
    padding: 0.25rem;
}

/* ==========================================
   BORDERS & RADIUS
   Bordes y esquinas redondeadas
   ========================================== */
.rounded-xs {
    border-radius: 3px;
}

.rounded-md {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.border-light-gray {
    border-color: var(--color-disabled) !important;
}

/* ==========================================
   OVERLAY & BACKDROP
   Fondos oscuros para modales
 ========================================== */
.backdrop-dark {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.overlay-light {
    background: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   FLEX UTILITIES
   Complementos a las utilidades flex de Bootstrap
   ========================================== */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.flex-end {
 display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ==========================================
   TRANSITIONS & ANIMATIONS
 Transiciones suaves
   ========================================== */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* ==========================================
   HOVER EFFECTS
   Efectos de hover reutilizables
   ========================================== */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.hover-shadow {
    transition: box-shadow 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   RESPONSIVE UTILITIES
   Ajustes para diferentes tamaños de pantalla
   ========================================== */
@media (max-width: 768px) {
    .binas-scrollable {
    max-height: 60vh;
        min-height: 40vh;
    }
    
    .legend-swatch {
        width: 14px;
        height: 14px;
    }
    
    .icon-xs {
        font-size: 10px;
    }
    
    .icon-sm {
        font-size: 12px;
    }
    
    .icon-md {
        font-size: 14px;
    }
    
    .icon-lg {
font-size: 18px;
    }
    
    .stats-card-compact {
   padding: 0.5rem;
    }
    
    .stats-card-compact .badge {
        font-size: 1.25rem;
     padding: 0.375rem 0.75rem;
}
}

@media (max-width: 480px) {
    .binas-scrollable {
        max-height: 50vh;
        min-height: 30vh;
    }
    
    .legend-swatch {
        width: 12px;
    height: 12px;
        margin-right: 6px;
    }
    
    .text-block-small {
        font-size: 0.65rem;
  }
}

/* ==========================================
   PRINT STYLES
   Estilos para impresión
   ========================================== */
@media print {
    .backdrop-dark,
    .overlay-light {
    display: none !important;
    }
    
    .binas-scrollable {
        max-height: none;
        min-height: auto;
        overflow: visible;
    }
}

/* ==========================================
   ACCESSIBILITY
   Mejoras de accesibilidad
   ========================================== */
.visually-hidden {
  position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
 overflow: hidden;
  clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para navegación por teclado — SOLO para links y buttons, NO para form controls */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="menuitem"]:focus-visible {
    outline: 2px solid var(--category-trend);
    outline-offset: 2px;
}

/* Form controls: sin outline, confía en border/box-shadow definido en componentes específicos */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="combobox"]:focus-visible,
[role="listbox"]:focus-visible {
    outline: none !important;
}

/* ==========================================
   CUSTOM SCROLLBARS
 Barras de desplazamiento personalizadas
   ========================================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==========================================
   UTILITIES FOR SPECIFIC COMPONENTS
   Utilidades para componentes específicos
   ========================================== */

/* Geo Results Summary */
.geo-results-summary {
    background: var(--bs-light);
    border-radius: 8px;
    padding: 1rem;
}

/* Footer Logo */
.binas-footer-logo {
    height: 4em;
}

/* Panel Headers */
.panel-header-mobile {
    background: linear-gradient(135deg, var(--category-trend) 0%, #0056b3 100%);
    color: var(--text-light);
    padding: 1rem;
    border-radius: 8px 8px 0 0;
}

/* Modal Overlays */
.modal-backdrop-custom {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Loading Spinners */
.spinner-custom {
    border: 3px solid rgba(0, 123, 255, 0.2);
    border-top-color: var(--category-trend);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   FORM UTILITIES
   ========================================== */
.form-inline {
    display: inline;
}

/* ==========================================
   DISABLED/MUTED STATES
   ========================================== */
.disabled-card {
    opacity: 0.6;
    cursor: not-allowed;
}

.opacity-30 {
    opacity: 0.3;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-60 {
    opacity: 0.6;
}

.opacity-70 {
    opacity: 0.7;
}

.opacity-80 {
    opacity: 0.8;
}

/* ==========================================
   WIDTH & SPACING UTILITIES
   ========================================== */
.w-20px {
    width: 20px;
}

.w-24px {
    width: 24px;
}

.max-w-300 {
    max-width: 300px;
}

.spacer-inline {
    display: inline-block;
}

/* Table column widths */
.w-5-pct {
    width: 5%;
}

.w-10-pct {
    width: 10%;
}

.w-12-pct {
    width: 12%;
}

.w-16-pct {
    width: 16%;
}

.w-15-pct {
    width: 15%;
}

.identity-avatar-badge {
    width: 3rem;
    height: 3rem;
}

.dropdown-menu {
    background-color: var(--outlook-button-bg);
    border: var(--border-width) solid var(--outlook-button-border);
    border-radius: var(--radius-xs);
    box-shadow: var(--outlook-shadow-subtle);
    padding: var(--spacing-2) 0;
    min-width: 160px;
    font-weight: var(--font-weight-normal);
    color: var(--outlook-text-primary);
    transition: var(--transition-colors), box-shadow var(--transition-base);
    z-index: 1000;
}

.dropdown-item {
    padding: var(--spacing-3) var(--spacing-4);
    background-color: transparent;
    color: var(--outlook-text-secondary);
    cursor: pointer;
    transition: var(--transition-colors), background-color var(--transition-base);
}

    .dropdown-item:hover {
        background-color: var(--outlook-button-hover-bg);
        color: var(--outlook-text-primary);
    }

    .dropdown-item:focus,
    .dropdown-item:active {
        outline: none;
        background-color: var(--outlook-button-hover-bg);
        border-radius: var(--radius-xs);
        box-shadow: 0 0 0 0.2rem rgba(141, 141, 141, 0.25);
        color: var(--outlook-text-primary);
    }

.dropdown-divider {
    height: 1px;
    background-color: var(--outlook-button-border);
    margin: var(--spacing-2) 0;
}

/* ── Formula popover: ancho ampliado para nombres de variables largos ── */
.formula-popover {
    --bs-popover-max-width: 460px;
}
.formula-popover .popover-body {
    padding: 0.5rem 0.65rem;
}

/* ==========================================
   END OF BINAS UTILITIES
   ========================================== */
