/* ========================================
   CSS RESPONSIVE EQUILIBRADO PARA 1366x768
   Optimización balanceada entre espacio y legibilidad
======================================== */

/* SOLUCION EQUILIBRADA PARA 1366x768 */
@media screen and (min-width: 1300px) and (max-width: 1450px) {
    
    /* AJUSTE MODERADO DEL CONTENIDO */
    html {
        font-size: 15px !important; /* Reducido suavemente de 16px */
    }
    
    body {
        font-size: 0.9rem !important; /* Menos agresivo que 0.8rem */
        zoom: 0.95 !important; /* Zoom más sutil que 0.9 */
    }
    
    /* CONTENEDORES OPTIMIZADOS */
    .container-fluid {
        padding-left: 12px !important; /* Más espacio que 8px */
        padding-right: 12px !important;
        max-width: 98% !important;
    }
    
    .container {
        max-width: 1320px !important; /* Ligeramente más ancho */
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* NAVBAR COMPACTA PERO LEGIBLE */
    .navbar {
        min-height: 45px !important; /* No tan bajo como 40px */
        padding: 0.3rem 0.75rem !important; /* Más padding */
        font-size: 0.85rem !important; /* Más legible */
    }
    
    .navbar-brand {
        font-size: 1rem !important; /* Mantener tamaño decente */
        padding: 0.25rem 0 !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.85rem !important;
    }
    
    /* AJUSTAR PADDING SUPERIOR DEL BODY */
    .page-with-navbar {
        padding-top: 50px !important;
    }
    
    /* CARDS COMPACTAS PERO NO DIMINUTAS */
    .card {
        margin-bottom: 0.75rem !important;
        border-radius: 8px !important;
    }
    
    .card-body {
        padding: 1rem !important; /* No tan compacto como 0.8rem */
    }
    
    .card-title {
        font-size: 1rem !important; /* Mantener legibilidad */
        margin-bottom: 0.5rem !important;
    }
    
    .card-text {
        font-size: 0.85rem !important; /* Mejor que 0.75rem */
        margin-bottom: 0.75rem !important;
    }
    
    /* FORMULARIOS OPTIMIZADOS */
    .form-control, .form-select {
        padding: 0.4rem 0.6rem !important; /* Menos compacto */
        font-size: 0.85rem !important; /* Más legible */
        height: auto !important;
        min-height: 36px !important; /* Altura más cómoda */
    }
    
    .form-label {
        font-size: 0.85rem !important;
        margin-bottom: 0.3rem !important;
        font-weight: 600 !important;
    }
    
    .input-group-text {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
    }
    
    /* BOTONES BIEN PROPORCIONADOS */
    .btn {
        padding: 0.4rem 0.8rem !important; /* Más cómodos */
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .btn-lg {
        padding: 0.6rem 1rem !important;
        font-size: 0.95rem !important;
    }
    
    /* TABLAS LEGIBLES */
    .table {
        font-size: 0.8rem !important; /* Mejor que 0.75rem */
        margin-bottom: 0.75rem !important;
    }
    
    .table th {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
    }
    
    .table td {
        padding: 0.4rem 0.5rem !important;
        vertical-align: middle !important;
    }
    
    .table-responsive {
        font-size: 0.8rem !important;
    }
    
    /* MODALES PROPORCIONADOS */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: 85% !important; /* No tan estrecho */
    }
    
    .modal-lg {
        max-width: 75% !important;
    }
    
    .modal-xl {
        max-width: 85% !important;
    }
    
    .modal-header {
        padding: 0.75rem 1rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    .modal-footer {
        padding: 0.6rem 1rem !important;
    }
    
    .modal-title {
        font-size: 1rem !important;
    }
    
    /* ESPACIADO EQUILIBRADO */
    .mb-1 { margin-bottom: 0.2rem !important; }
    .mb-2 { margin-bottom: 0.4rem !important; }
    .mb-3 { margin-bottom: 0.6rem !important; }
    .mb-4 { margin-bottom: 0.8rem !important; }
    .mb-5 { margin-bottom: 1rem !important; }
    
    .mt-1 { margin-top: 0.2rem !important; }
    .mt-2 { margin-top: 0.4rem !important; }
    .mt-3 { margin-top: 0.6rem !important; }
    .mt-4 { margin-top: 0.8rem !important; }
    .mt-5 { margin-top: 1rem !important; }
    
    .py-1 { padding-top: 0.2rem !important; padding-bottom: 0.2rem !important; }
    .py-2 { padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; }
    .py-3 { padding-top: 0.6rem !important; padding-bottom: 0.6rem !important; }
    .py-4 { padding-top: 0.8rem !important; padding-bottom: 0.8rem !important; }
    .py-5 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    
    /* GRID LIGERAMENTE COMPACTO */
    .row {
        --bs-gutter-x: 0.75rem !important;
        --bs-gutter-y: 0.75rem !important;
    }
    
    .col-md-3, .col-md-4, .col-md-6 {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }
    
    /* DEBUG BAR AJUSTADA */
    .debug-info-bar {
        padding: 0.15rem 0.75rem !important;
        font-size: 0.7rem !important;
        top: 45px !important;
    }
    
    /* HEADINGS BIEN PROPORCIONADOS */
    h1 { font-size: 1.75rem !important; } /* Menos drástico */
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    h4 { font-size: 1.1rem !important; }
    h5 { font-size: 1rem !important; }
    h6 { font-size: 0.9rem !important; }
    
    /* ICONOS PROPORCIONALES */
    .bi {
        font-size: 0.95em !important;
    }
    
    /* ALERTS COMPACTOS */
    .alert {
        padding: 0.6rem 0.9rem !important;
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* BREADCRUMBS */
    .breadcrumb {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* PAGINATION */
    .pagination {
        font-size: 0.85rem !important;
    }
    
    .page-link {
        padding: 0.4rem 0.6rem !important;
    }
}

/* SOLUCION ESPECIFICA PARA 1366px EXACTO */
@media screen and (width: 1366px) {
    body::before {
        content: "🎯 OPTIMIZACIÓN 1366x768 EQUILIBRADA";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(40, 167, 69, 0.9); /* Verde más suave */
        color: white;
        padding: 10px 20px;
        border-radius: 5px;
        z-index: 10000;
        font-weight: bold;
        animation: fadeOut 3s forwards;
    }
    
    @keyframes fadeOut {
        0% { opacity: 1; }
        70% { opacity: 1; }
        100% { opacity: 0; display: none; }
    }
}
