/**
 * ARCHIVO DE COMPATIBILIDAD SERVIDOR-LOCAL
 * ImpulsaVet - Hospital Veterinario Alfa Animal
 * 
 * Este archivo garantiza que los estilos se vean igual
 * en XAMPP y en el servidor de producción
 */

/* RESET Y CONFIGURACIÓN BASE */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
}

html {
    /* NO USAR TRANSFORM SCALE - causa problemas en servidor */
    /* transform: scale(0.9); REMOVIDO */
    font-size: 16px; /* Tamaño base consistente */
    line-height: 1.5;
}

body {
    /* Configuración consistente entre entornos */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: #f8f9fa !important;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* CONTENEDORES PRINCIPALES */
.container-fluid, .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.main-content {
    padding-top: 80px !important; /* Fijo para evitar variaciones */
    min-height: calc(100vh - 80px) !important;
    background-color: #f8f9fa !important;
}

/* NAVBAR FIJO */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    height: 60px !important; /* Altura fija */
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2e 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* SIDEBAR CONSISTENTE */
.sidebar {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    width: 250px !important;
    height: calc(100vh - 60px) !important;
    background-color: white !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
    transition: transform 0.3s ease !important;
    z-index: 1000 !important;
}

.sidebar.collapsed {
    transform: translateX(-100%) !important;
}

.content-area {
    margin-left: 250px !important;
    padding: 20px !important;
    min-height: calc(100vh - 60px) !important;
    background-color: #f8f9fa !important;
    transition: margin-left 0.3s ease !important;
}

.content-area.expanded {
    margin-left: 0 !important;
}

/* CARDS Y COMPONENTES */
.card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    background-color: white !important;
    margin-bottom: 20px !important;
}

.card-header {
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2e 100%) !important;
    color: white !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 15px 20px !important;
    border: none !important;
}

.card-body {
    padding: 20px !important;
    background-color: white !important;
}

/* BOTONES CONSISTENTES */
.btn-primary {
    background-color: #ff6b35 !important;
    border-color: #ff6b35 !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #e55a2e !important;
    border-color: #e55a2e !important;
    color: white !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

/* FORMULARIOS */
.form-control {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    background-color: white !important;
}

.form-control:focus {
    border-color: #ff6b35 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25) !important;
    background-color: white !important;
}

/* TABLAS */
.table {
    background-color: white !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.table thead th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
    font-weight: 600 !important;
    padding: 12px !important;
}

.table tbody td {
    padding: 12px !important;
    vertical-align: middle !important;
}

/* RESPONSIVE CONSISTENTE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%) !important;
    }
    
    .content-area {
        margin-left: 0 !important;
        padding: 10px !important;
    }
    
    .card {
        margin-bottom: 15px !important;
    }
    
    .card-body {
        padding: 15px !important;
    }
}

/* FUENTES SEGURAS - fallback si Google Fonts falla */
@font-face {
    font-family: 'Inter-Fallback';
    src: local('Arial'), local('Helvetica'), local('sans-serif');
    font-weight: 400;
    font-style: normal;
}

/* Aplicar fuente fallback si Inter no carga */
body, .form-control, .btn, .card, .navbar-brand {
    font-family: 'Inter', 'Inter-Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
}

/* EVITAR PROBLEMAS DE CARGA DE RECURSOS */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* LOGIN PAGE - Estilos específicos sin escalado */
body.login-page {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f1f3f4 100%) !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.login-container {
    width: 100% !important;
    max-width: 460px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

.login-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 24px !important;
    padding: 2rem !important;
    border: 1px solid rgba(255, 107, 53, 0.15) !important;
    box-shadow: 0 25px 50px -12px rgba(255, 107, 53, 0.15) !important;
}

/* UTILIDADES PARA DEBUGGING */
.debug-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 9999;
    display: none; /* Oculto por defecto */
}

/* Mostrar info de debug en desarrollo */
.debug-mode .debug-info {
    display: block;
}

/* CORRECCIONES ESPECÍFICAS PARA SERVIDOR */
/* Evitar problemas con viewport en móviles */
@viewport {
    width: device-width;
    zoom: 1.0;
}

/* Asegurar que no haya elementos que causen scroll horizontal */
* {
    max-width: 100%;
}

/* Evitar problemas con flexbox en navegadores antiguos */
.d-flex {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
}

.justify-content-center {
    -webkit-box-pack: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
}

.align-items-center {
    -webkit-box-align: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
}
