/* =======================
   SIDEBAR
========================== */
.sidebar {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                url('/assets/images/navbar2.jpg') no-repeat center center;
    background-size: cover;
    width: 80px;
    transition: width 0.4s;
    overflow: hidden;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
}

.sidebar:hover {
    width: 270px;
    box-shadow: 6px 0 15px rgba(0, 0, 0, 0.8);
}

/* Texto del menú */
.sidebar .menu-text {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.sidebar:hover .menu-text {
    opacity: 1;
}

/* =======================
   MENÚ PRINCIPAL
========================== */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 40px; 
    line-height: 40px;
    white-space: nowrap;
    overflow: hidden;
    padding-right:30px;
}

.sidebar .nav-item {
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Fondo más claro */
    transition: background-color 0.3s ease-in-out;
}

/* =======================
   SUBMENÚS
========================== */
.sidebar .nav-item .submenu {
    display: block;
    max-height: 0;
    overflow: hidden;
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
    transition: max-height 0.5s ease;
}

.sidebar .nav-item.active .submenu {
    max-height: 300px;
}

.sidebar .submenu-item a {
    font-size: 0.9rem;
    text-decoration: none;
    display: block;
    padding: 7px;
    width: calc(100% + 10px); /* Expande el ancho ligeramente */
    margin-left: -15px; /* Desplaza el efecto hacia la izquierda */
    padding-left: 25px; /* Ajusta el padding para compensar */
    border-radius: 4px; /* Opcional: Esquinas más suaves */
}

.sidebar .submenu-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease-in-out;
}


/* =======================
   ICONOS Y FLECHAS
========================== */
.menu-arrow {
    /* float: right; */
    font-size: 14px;
    right: 15px;
    position:absolute;
    transition: transform 0.3s ease-in-out;
}

/* Rota el triángulo cuando el menú está expandido */
.nav-item.active .menu-arrow {
    transform: rotate(180deg);
}

/* Oculta el triángulo cuando el navbar está contraído */
.sidebar:not(:hover) .menu-arrow {
    display: none;
}

/* Muestra el triángulo con un delay de 0.4s cuando el navbar está expandido */
.sidebar:hover .menu-arrow {
    display: inline-block;
}

/* =======================
   HEADER
========================== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #03203d; /* Azul corporativo */
    text-align: center;
}

/* =======================
   LOGOS Y USUARIO
========================== */
.logo img {
    transition: all 0.3s;
}

.sidebar .logo img {
    width: 150px; 
    height: auto;
}

.logo-bottom {
    margin: 2px;
    background: rgba(239, 253, 223, 0.1);
    position: absolute;
    bottom: 20px;
}

.logo-bottom img {
    margin: 2px;
    max-width: 80%;
    transition: all 0.3s;
}

/* =======================
   USER INFO
========================== */
.user-info-container {
    display: none;
    transition: all 0.3s ease;
}

.sidebar:hover .user-info-container {
    display: block;
}

.user-info {
    height: auto;
    padding: 10px 20px;
    border-bottom: 3px double #ffffff;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ===== ICONO CÍRCULO EN MENÚS Y SUBMENÚS ===== */
.menu-dot {
    position: absolute;
    right: 15px;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 50%;
    opacity: 0.7;
    display: inline-block;
    transition: all 0.08s ease-in-out;
}
.submenu-item .menu-dot {
    transform: translateY(60%);  /* Lo ajusta mejor */
}

/* Ocultar el círculo cuando el sidebar está contraído */
.sidebar:not(:hover) .menu-dot {
    display: none;
}

/* SOLO SE MUESTRAN LOS `menu-dot` EN ÍTEMS QUE NO SON DESPLEGABLES */
.menu-toggle .menu-dot {
    display: none !important;
}

/* Inicialmente ocultos con transición */
.sidebar .submenu .menu-dot {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    will-change: opacity, visibility;
}

/* Se muestran con retraso cuando el menú padre está activo */
.sidebar .nav-item.active .submenu .menu-dot {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-in-out, visibility 0s linear;
}

/* Desaparición más rápida */
.sidebar .submenu:not(.active) .menu-dot {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0s linear 0.2s;
}

/* ===== EFECTO CUANDO ESTÁ ACTIVO (CÍRCULO RELLENO + BRILLO) ===== */
.menu-dot.active {
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
    opacity: 1;
}

/* ===== EFECTO HOVER (BRILLO AL PASAR EL RATÓN) ===== */
.nav-link:hover .menu-dot,
.submenu-item a:hover .menu-dot {
    background-color: #104fd8; /* Aqua color in classic hex format */
    color:rgba(0, 255, 255, 0.671);
    box-shadow: 0 0 5px currentColor;
    opacity: 1;
}

/* =======================
   USER INFO
========================== */

/* Ocultar user-label y user-name cuando el sidebar está contraído */
#user-label, #user-name, #timer-label {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

/* Mostrar user-label y user-name cuando el sidebar está expandido */
.sidebar:hover #user-label, 
.sidebar:hover #user-name,
.sidebar:hover #timer-label {
    opacity: 1;
    visibility: visible;
    display: block;
}
.sidebar:hover #auth-button {
    border: 1px solid #fff;
}
#auth-button{
    color: #fff;
}
#auth-button:hover {
    background-color: #ffffff71;
    color:#104fd8;

}
/* Mantener siempre visible el timer y su etiqueta */
#timer {
    opacity: 1 !important;
    visibility: visible !important;
}
/* Estilos base del timer */
#timer {
    font-weight: bold;
    color: #22cc22; /* Verde por defecto */
    transition: color 0.3s ease-in-out;
}

/* Estado crítico (menos de 3 minutos) */
.timer-warning {
    color: orange !important;
}

/* Estado de alerta (menos de 1 minuto) */
.timer-danger {
    color: red !important;
    font-weight: bold;
}
