/* CSS personalizado para fix del dropdown de usuario */

/* Clase personalizada para el contenedor del dropdown */
.custom-user-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}

/* Toggle del dropdown personalizado - Diseño moderno */
.custom-dropdown-toggle {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    color: var(--gray-700);
    text-decoration: none !important;
    background: var(--white);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    font-size: var(--text-sm);
    font-weight: 500;
}

.custom-dropdown-toggle:hover {
    background-color: var(--gray-50) !important;
    color: var(--primary-600) !important;
    border-color: var(--primary-200) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.custom-dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Flecha del dropdown */
.custom-dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.3s ease;
}

.custom-dropdown-toggle.active::after,
.custom-dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Menú dropdown personalizado - Diseño moderno */
.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    max-width: 300px;
    padding: var(--space-2) 0;
    margin: var(--space-2) 0 0;
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Mostrar el menú */
.custom-dropdown-menu.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Items del menú */
.custom-dropdown-menu li {
    list-style: none;
    position: relative;
}

/* Línea divisoria sutil entre items */
.custom-dropdown-menu li:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-4);
    right: var(--space-4);
    height: 1px;
    background: var(--gray-100);
}

.custom-dropdown-menu .btn {
    display: block;
    width: 100%;
    padding: var(--space-2_5) var(--space-4);
    color: var(--gray-700);
    text-decoration: none;
    background-color: transparent;
    border: 0;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
}

.custom-dropdown-menu .btn:hover,
.custom-dropdown-menu .btn:focus {
    color: var(--primary-600);
    background-color: var(--gray-50);
    text-decoration: none;
    padding-left: calc(var(--space-4) + var(--space-1));
}

.custom-dropdown-menu .btn i {
    width: 18px;
    margin-right: var(--space-2);
    text-align: center;
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.custom-dropdown-menu .btn:hover i {
    color: var(--primary-600);
}

/* Imagen en el toggle */
.custom-dropdown-toggle img {
    max-height: 35px;
    max-width: 35px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Para imágenes grandes en el dropdown */
.custom-dropdown-menu img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 991px) {
    .custom-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 220px;
        margin-top: 5px;
    }
}

@media (max-width: 767px) {
    .custom-user-dropdown {
        margin-left: 12px;
    }

    .custom-dropdown-menu {
        min-width: 200px;
        max-width: 250px;
    }

    .custom-dropdown-toggle {
        padding: 6px 8px;
    }
}

/* Fix para evitar conflictos con el tema existente */
.right_bar_top .custom-user-dropdown .custom-dropdown-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.right_bar_top .custom-user-dropdown .custom-dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Estilos adicionales para compatibilidad */
.custom-dropdown-toggle.btn-default {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Centrar imagen cuando no hay texto */
.custom-dropdown-toggle-image-only {
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 5px;
}

.custom-dropdown-toggle-image-only::after {
    display: none;
}

/* Para el avatar grande */
.imagen_usuario_custom {
    height: auto;
    width: 50px;
    text-align: center;
    display: flex;
    align-items: center;
}

.imagen_usuario_custom img {
    max-width: 75%;
    height: auto;
    border-radius: 50%;
}