/* Añadir efecto de desenfoque y transición */
.fade-out {
    position: relative;
    animation: fadeOut 0.8s ease-out forwards; /* Añadir forwards para mantener el estado final de la animación */
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        filter: blur(0px);
        background: transparent;
    }
    100% {
        opacity: 0;
        filter: blur(10px);
        background: linear-gradient(to top, #2C9DBC 0%, #67CEAA 100%);
    }
}

#nav-toggle {
    text-align: center;
}
#nav-toggle:checked ~ #nav-header {
    width: calc(var(--navbar-width-min) - 16px);
}
#nav-toggle:checked ~ #nav-content,
#nav-toggle:checked ~ #nav-footer {
    width: var(--navbar-width-min);
}
#nav-toggle:checked ~ #nav-header #nav-title {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}
#nav-toggle:checked ~ #nav-content .nav-button span {
    opacity: 0;
    transition: opacity 0.1s ease-out;
}
#nav-toggle:checked ~ #nav-footer #nav-footer-avatar {
    margin-left: 0;
    left: 50%;
    transform: translate(-50%);
}
#nav-toggle:checked ~ #nav-footer #nav-footer-titlebox {
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
}
#nav-toggle:checked ~ #nav-footer #nav-footer-logout {
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
    margin: 0;
}
#nav-toggle:checked ~ #nav-footer #themeToggle {
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
    margin: 0;
}
#nav-toggle:checked ~ #nav-footer #languageToggle {
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
    margin: 0;
}

#mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black background */
    backdrop-filter: blur(5px); /* Apply blur effect */
    z-index: 2; /* Ensure it's below the navbar when open, or adjust as needed */
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Start hidden */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Smooth transition */
    pointer-events: none; /* Initially disable clicks on the overlay */
}
body.sidebar-open #mobile-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Enable clicks on the overlay when active */
}

#nav-bar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(var(--navbar-yusapi1), var(--navbar-yusapi2));
    border-radius: 0px var(--esquina-redondeada) var(--esquina-redondeada) 0px;
    display: flex;
    flex-direction: column;
    color: var(--navbar-light-primary);
    font-family: var(--font-primary);
    overflow: hidden;
    user-select: none;
    z-index: 3;
    transition: transform 0.3s ease;
}

#mobile-menu-button {
    z-index: 4;
    margin-top: 5px;
}

#nav-bar hr {
    margin: 5px 20px;
    border: none;
    border-top: solid 1px var(--navbar-light-secondary);
}
#nav-bar a {
    color: inherit;
    text-decoration: none;
}
#nav-bar input[type=checkbox] {
    display: none;
}

#nav-header {
    position: relative;
    width: calc(var(--navbar-width) - 16px);
    left: 8px;
    padding-top: 10px;
    height: 80px;
    background: var(--navbar-yusapi1);
    border-radius: var(--esquina-redondeada);
    z-index: 2;
    display: flex;
    align-items: center;
    transition: width 0.2s;
}

label {
    display: inline-block;
}

#nav-header label {
    pointer-events: none;
}

#nav-content {
    margin: -16px 0;
    padding: 16px 0;
    position: relative;
    flex: 1;
    width: var(--navbar-width);
    background: linear-gradient(var(--navbar-yusapi1), var(--navbar-yusapi2));
    direction: rtl;
    overflow-x: hidden;
    transition: width 0.3s;
}
#nav-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#nav-content::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background-color: white !important;
}
#nav-content-highlight {
    position: absolute;
    left: 16px;
    top: -70px;
    width: calc(100% - 16px);
    height: 54px;
    background: var(--background);
    background-attachment: fixed;
    border-radius: 16px 0 0 16px;
    transition: top 0.2s;
}
#nav-content-highlight:before,
#nav-content-highlight:after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 16px 16px var(--background);
}
#nav-content-highlight:after {
    top: 100%;
    box-shadow: 16px -16px var(--background);
}

.nav-button {
    position: relative;
    margin-left: 16px;
    height: 54px;
    display: flex;
    align-items: center;
    color: var(--navbar-light-secondary);
    direction: ltr;
    cursor: pointer;
    z-index: 1;
    transition: color 0.2s;
}
.nav-button span {
    padding-top: 5px;
    transition: opacity 1s; /* This will be overridden by the specific rule above */
    color: white;
    white-space: nowrap; /* Prevents text from wrapping */
    overflow: hidden; /* Hides overflowing text */
    text-overflow: ellipsis; /* Adds an ellipsis if text is cut off (optional) */
}
.nav-button .fas {
    transition: transform 0.2s ease, color 0.2s ease;
}
.nav-button:hover .fas {
    transform: scale(1.1);
    color: #fff;
}
.nav-button:hover,
.nav-button.active {
    color: #ffffff;
}

#nav-content .fas {
    min-width: 3rem;
    text-align: center;
    color: white;
}

#nav-footer {
    position: relative;
    width: var(--navbar-width);
    height: 54px;
    background: var(--navbar-yusapi2);
    display: flex;
    flex-direction: column;
    z-index: 2;
    transition: width 0.2s, height 0.2s;
}
#nav-footer-heading {
    position: relative;
    width: 100%;
    height: 54px;
    display: flex;
}

#nav-footer-avatar {
    position: relative;
    margin: 11px 0 11px 15px;
    width: 32px;
    height: 32px;
    transition: 0.2s;
}

#nav-footer-logout, #themeToggle, #languageToggle {
    margin: 10px 5px;
    display: flex;
    align-items: baseline;
    cursor: pointer;
}
#nav-footer-logout i, #themeToggle, #languageToggle {
    transition: transform 0.3s ease, color 0.3s ease;  /* Transición suave para transformaciones y color */
}
#nav-footer-logout i:hover, #themeToggle:hover, #languageToggle:hover {
    transform: scale(1.1); /* Aumenta el tamaño del icono */
}

#nav-footer-avatar i {
    height: 100%;
}

#nav-footer-titlebox {
    position: relative;
    width: 100px;
    display: flex;
    flex-direction: column;
    transition: opacity 1s;
}
#nav-footer-titlebox #nav-footer-subtitle,
#nav-footer-titlebox .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#nav-footer-subtitle {
    color: white;
    font-size: 0.7rem;
}

.nav-button.active {
    color: white; 
    transition: background-color 0.3s ease, color 0.3s ease; 
}
.nav-button.active i,
.nav-button.active d,
.nav-button.active span {
    color: var(--navbar-selecction) !important; 
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 70px;
    background-color: #111;
    transition: width 0.3s ease;
    overflow: hidden;
}
#sidebar:hover {
    width: 200px;
}

#nav-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.logo {
    width: 55px;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.nav-button.active,
.nav-button.active i,
.nav-button.active span,
.nav-button.active svg,
.nav-button.active svg use {
    color: var(--navbar-selecction) !important;
    fill: var(--navbar-selecction) !important;
}

#nav-header label {
    height: 49px !important;
    margin-top: 16px !important;
}

.nav-button span {
    height: 24px !important;
    padding-top: 0px !important;
}
.nav-button i.fas {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

span.exception-span {
    margin-top: 5px;
}

#nav-footer-logout .fas, #themeToggle, #languageToggle {
    display: flex;
    height: 25px;
    align-items: center;
    justify-content: center;
}

.btn-seleccionado {
    background-color: var(--navbar-yusapi2) !important;
    border-color: var(--navbar-yusapi2) !important;
    color: white;
    border-radius: var(--esquina-redondeada) !important;
}
