/* Custom Styles */


:root {
    --primary-color: #7ba181;
    --primary-color-hover: #5a7a5a;
    --primary-color-rgb: 123, 161, 129;
    --primary-color-hover-rgb: 90, 122, 90;

    --bs-primary: var(--primary-color);
    --bs-primary-rgb: var(--primary-color-rgb);
    --bs-nav-link-color: var(--primary-color);
    --bs-link-color: var(--primary-color);
    --bs-link-hover-color: var(--primary-color-hover);
    --bs-nav-link-hover-color: var(--primary-color-hover);

    --color-aplicacion: #7ba181;
    
    --bs-link-color-rgb: var(--primary-color-rgb);
    --bs-link-hover-color-rgb: var(--primary-color-hover-rgb);

    --secondary-color: #6c757d;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--primary-color);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 
   ----------------
   BOOTRAP OVERRIDE 
   ----------------  
*/   

.bg-dark {
    background-color:#282828 !important;
}

/* Animaciones de desplazamiento para la barra lateral */
@keyframes barra-entrada {
    0%   { margin-left: -250px; }
    100% { margin-left: 0px;   }
}

@keyframes barra-salida {
    0%   { margin-left: 0px;    }
    100% { margin-left: -250px; }
}

#sidebar-wrapper {
    transition: none;
}

#sidebar-wrapper.barra-abriendo {
    animation: barra-entrada 0.3s linear forwards;
}

#sidebar-wrapper.barra-cerrando {
    animation: barra-salida 0.3s linear forwards;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar submenu: rotación del chevron al expandir */
.transition-chevron {
    transition: transform 0.3s ease;
}

[aria-expanded="true"] .transition-chevron {
    transform: rotate(180deg);
}

/* Fondo ligeramente diferenciado para subitems del menú */
#sidebar-wrapper .collapse .list-group-item {
    background-color: #1e1e1e !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s;
}


/* Forms */
.form-control:focus {
    border-color:  var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

/* En Bootstrap 5.3 los <select> deben usar form-select para mostrar la flecha.
   Este estilo corrige selects que tengan form-control por compatibilidad. */
select.form-control,
select.form-control-sm {
    appearance: auto;
    -webkit-appearance: auto;
}

/* Normalizar altura entre form-control-sm (inputs) y form-select-sm (selects)
   para que ambos queden alineados en la misma fila */
.form-control-sm,
.form-select-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.5;
}



/* Horizontal Rule */
hr {
    border-top: 1px solid #afafaf;
    opacity: 1;
}

/* Buttons */
.btn {
    border-radius: 5px;
}

/* Sobreescribir color del botón principal con el color primario del tema */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    opacity: 0.9;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Chat messages */
#chat-messages .badge {
    max-width: 80%;
    word-wrap: break-word;
}

/* Responsive */
@media (max-width:  768px) {
    #sidebar-wrapper {
        margin-left: -250px;
    }
    
    #sidebar-wrapper.active {
        margin-left: 0;
    }
}


.form-control, .form-select {
    background-color: #d8dbdd;
}


/* iconos color fontawesome */
.fa, .fas {
    color: #636d65;
} 

/* tooltip ancho para mensajes largos  */
.tooltip-ancho-75-percent {
    --bs-tooltip-max-width: min(75vw, 1100px);
}

.tooltip-ancho-75-percent .tooltip-inner {
    width: min(75vw, 1100px);
    max-width: min(75vw, 1100px);
    min-height: 140px;
    height: min(60vh, 520px);
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: normal;
    line-height: 1.35;
    text-align: left;
}
    
/* formularios */

.error-message {
    color: #dc3545; 
    font-size: 0.875em;
}

/* Botón Guardar Fijo */
.btn-save-fixed {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
}

.btn-save-fixed .btn {
    transition: all 0.3s ease;
}

.btn-save-fixed .btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
}


.label-ia {
    position: relative;
    /*background-color: #ffffff;*/
    z-index: 1;
}
.label-ia::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: rgba(118, 221, 85, 0.3);
    z-index: -1;
    filter: blur(20px);
}


.label-ia-vivo {
    position: relative;
    background-color: #ffffff;
    z-index: 1;
}

.label-ia-vivo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(118, 221, 85, 0.3);
    z-index: -1;
    filter: blur(16px);
    animation: colorTransition .5s infinite alternate;
}

@keyframes colorTransition {
    from {
        background: rgba(118, 221, 85, 0.3);
    }
    to {
        background: rgba(255, 255, 255, 0.3);
    }
}
