/* ===============================================
   1. LOGOS Y COMPORTAMIENTO DEL SIDEBAR
   =============================================== */
/* Contenedor del logo */
.navbar-vertical .navbar-brand {
    padding-left: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    overflow: visible !important;
}

/* El botón hamburguesa*/
.toggle-icon-wrapper {
    margin-right: 0px !important;
    min-width: 35px !important;
}

/* Logo Grande */
.main-logo-full {
    width: 165px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Logo Icono*/
.main-logo-short {
    width: 38px;
    height: auto;
    display: none;
}

/* --- LÓGICA DE VISIBILIDAD DE LOGOS --- */
html:not(.navbar-vertical-collapsed) .main-logo-full {
    display: block !important;
}

html:not(.navbar-vertical-collapsed) .main-logo-short {
    display: none !important;
}

.navbar-vertical-collapsed .main-logo-full {
    display: none !important;
}

.navbar-vertical-collapsed .main-logo-short {
    display: block !important;
    margin-left: 8px;
}

/* --- AJUSTE DE ALTURA PARA MENÚS LARGOS --- */
.navbar-vertical-content {
    padding-bottom: 80px !important;
}

.navbar-vertical {
    height: 100vh !important;
}

/* ===============================================
   2. ESTILOS DEL FOOTER STARSOL
   =============================================== */
.footer-starsol-container {
    background-color: #121e2d !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.footer-starsol-title {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.footer-starsol-copy {
    font-size: 0.72rem;
    color: #a6b5cc !important;
}

.footer-starsol-link {
    color: #ff8533 !important;
    font-weight: 600 !important;
    transition: 0.15s;
}

.footer-starsol-link:hover {
    color: #ff9e47 !important;
    text-decoration: underline !important;
}


/* ===============================================
   3. BOTÓN DE SALIR (LOGOUT) STARSOL
   =============================================== */
.btn-logout-starsol {
    background-color: #ff8533 !important;
    border-color: #ff8533 !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.2rem 1rem;
    margin-bottom: 0px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-logout-starsol:hover {
    background-color: #e6762d !important;
    border-color: #e6762d !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px);
}

.btn-logout-starsol .fas {
    font-size: 0.9rem;
}

/* ===============================================
   4. BARRA DE BÚSQUEDA DEL MENÚ (GRANDE Y BLANCA)
   =============================================== */

/* Contenedor */
.search-wrapper {
    background-color: #EDF2F9 !important;
    z-index: 10;
    padding: 15px 15px 10px 15px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* El input de búsqueda */
.search-input {
    background-color: #ffffff !important;
    height: 45px !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    padding-left: 40px !important;
    border: 1px solid #d8e2ef !important;
    color: #344050 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease-in-out !important;
}

/* Icono de lupa */
.search-box-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #748194;
    z-index: 11;
    font-size: 1rem !important;
}

/* Foco */
.search-input:focus {
    border-color: #ff8533 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 133, 51, 0.2) !important;
    transform: scale(1.02);
}

/* Ajuste del placeholder (texto de ayuda) */
.search-input::placeholder {
    color: #9da9bb !important;
    font-weight: 500;
}

/* Ocultar en menú colapsado */
.navbar-vertical-collapsed .search-wrapper {
    display: none !important;
}

/* ===============================================
   5. PERSONALIZACIÓN DEL SCROLLBAR (FIJO Y CLARO)
   =============================================== */

/* Ancho del scroll (delgado y elegante) */
.navbar-vertical-content::-webkit-scrollbar {
    width: 6px !important;
}

/* Fondo*/
.navbar-vertical-content::-webkit-scrollbar-track {
    background: #EDF2F9 !important;
}

/* La barrita (Thumb) */
.navbar-vertical-content::-webkit-scrollbar-thumb {
    background: #cbd5e0 !important;
    border-radius: 10px !important;
}

.navbar-vertical-content:hover::-webkit-scrollbar-thumb,
.navbar-vertical-content::-webkit-scrollbar-thumb:hover {
    background: #cbd5e0 !important;
}

.navbar-vertical-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #EDF2F9;
}

/* ===============================================
   6. ARQUITECTURA DEL MENÚ VERTICAL (FIXED FOOTER)
   =============================================== */

/* El contenedor principal debe ocupar el alto disponible y ser un flexbox */
#navbarVerticalCollapse {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 110px) !important;
    /* Altura total menos el logo/buscador */
}

/* La parte de arriba (módulos) crece todo lo que puede y hace scroll */
.navbar-vertical-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 10px !important;
}

/* La parte de abajo (botones) se queda siempre fija al final */
.settings-fixed {
    flex-shrink: 0 !important;
    /* Evita que se aplaste */
    background-color: #EDF2F9 !important;
    /* Tu color azul claro */
    width: 100% !important;
}

/* Estilo del botón "Volver a Cuenta" */
.btn-impersonate-starsol {
    background-color: transparent !important;
    border: 1px solid #e63757 !important;
    color: #e63757 !important;
    font-weight: 700 !important;
}

.btn-impersonate-starsol:hover {
    background-color: #e63757 !important;
    color: white !important;
}


/* ===============================================
   7. MEJORA DE VISIBILIDAD EN MODO COLAPSADO (HOVER)
   =============================================== */

/* --- BUSCADOR --- */
/* 1. Por defecto, oculto cuando está colapsado */
.navbar-vertical-collapsed .search-wrapper {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 2. PERO, si el usuario pasa el mouse sobre el menú colapsado, lo mostramos */
.navbar-vertical-collapsed .navbar-vertical:hover .search-wrapper {
    display: block !important;
    opacity: 1;
}

/* --- BOTONES DE SALIDA (PIE FIJO) --- */
/* 3. Por defecto, oculto cuando está colapsado */
.navbar-vertical-collapsed .settings-fixed {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Si el usuario pasa el mouse, mostramos el pie fijo con Salir e Impersonate */
.navbar-vertical-collapsed .navbar-vertical:hover .settings-fixed {
    display: block !important;
    opacity: 1;
}

.navbar-vertical-collapsed .navbar-vertical:not(:hover) .btn-logout-starsol {}


/* ===============================================
   8. ESTILOS DEL NAVBAR 
   =============================================== */
.text-orange {
    color: #fd7e14;
}

/* Contenedor principal */
.greeting-pill {
    border: 1px solid #EDF2F9;
    height: 60px;
    display: flex;
    align-items: center;
    background-color: white;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Contenedor de los textos */
.greeting-text-container {
    flex: 1;
    overflow: hidden;
    height: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Saludo principal */
.main-greeting {
    height: 22px;
    line-height: 22px;
    margin: 0;
}

/* Contenedor del carrusel con máscara para que no se vea lo que sube/baja */
.carousel-mask {
    height: 20px;
    overflow: hidden;
    position: relative;
}

.v-carousel {
    display: block;
    position: relative;
    animation: v-slide-clean 12s infinite ease-in-out;
}

.v-item {
    height: 20px;
    line-height: 20px;
    display: block;
}

/* Animación */
@keyframes v-slide-clean {

    0%,
    20% {
        transform: translateY(0);
    }

    25%,
    45% {
        transform: translateY(-20px);
    }

    50%,
    70% {
        transform: translateY(-40px);
    }

    75%,
    95% {
        transform: translateY(-60px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ===============================================
   9. COMPORTAMIENTO RESPONSIVE DEL MENÚ (MÓVILES)
   =============================================== */

/* Overlay oscuro - solo visible en móviles */
.navbar-overlay {
    display: none;
}

@media (max-width: 1199.98px) {

    /* Comportamiento del menú en móviles */
    .navbar-vertical .navbar-collapse {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background-color: #f9fafd !important;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2) !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding-top: 70px !important;
    }

    /* Cuando el menú está abierto en móvil */
    .navbar-vertical .navbar-collapse.show {
        left: 0 !important;
    }

    /* Durante la animación de cierre */
    .navbar-vertical .navbar-collapse.collapsing {
        left: -100% !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Header fijo en móviles */
    .navbar-vertical>.d-flex.align-items-center {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10000 !important;
        background-color: #f9fafd !important;
        padding: 0.75rem 1rem !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        border-bottom: 1px solid #e3e6ed !important;
    }

    .navbar-toggler-humburger-icon {
        z-index: 10001 !important;
        position: relative;
    }

    /* Overlay oscuro */
    .navbar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s ease;
    }

    .navbar-overlay.show {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    /* Ocultar el logo STARSOL naranja en móviles dentro del menú */
    .navbar-vertical>.d-flex.align-items-center .navbar-brand img {
        display: none !important;
    }

    /* Ajustar el fondo de la barra de búsqueda en móviles */
    .navbar-collapse .search-wrapper {
        background-color: #f9fafd !important;
    }

    /* IMPORTANTE: En móviles, SIEMPRE mostrar el texto completo */
    .navbar-vertical .nav-link-text,
    .navbar-vertical h4,
    .navbar-vertical h5,
    .navbar-vertical .badge {
        display: block !important;
    }
}