/* =====================================================
   ESTILOS PARA DROPDOWNS DEL HEADER
   ===================================================== */

/* Contenedor del header con overflow visible */
header {
    overflow: visible !important;
    position: relative;
    z-index: 1000;
}

/* Contenedor principal del header */
.header-container {
    overflow: visible !important;
    position: relative;
}

/* Estilos para los dropdowns */
#notificacionesDropdown,
#perfilDropdown {
    position: absolute !important;
    z-index: 9999 !important;
    min-width: 320px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transform-origin: top center;
    animation: dropdownSlideIn 0.2s ease-out;
}

/* Dropdown de notificaciones */
#notificacionesDropdown {
    right: 0;
    left: auto;
    transform: translateX(0);
    width: 320px;
}

/* Dropdown del perfil */
#perfilDropdown {
    right: 0;
    left: auto;
    transform: translateX(0);
    width: 280px;
}

/* Animación de entrada */
@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Contenedor de notificaciones */
.notificaciones-container {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.notificaciones-container::-webkit-scrollbar {
    width: 6px;
}

.notificaciones-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.notificaciones-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.notificaciones-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Estilos para las notificaciones individuales */
.notificacion-item {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.notificacion-item:hover {
    background-color: #f8fafc;
    transform: translateX(2px);
}

/* Estilos para el perfil del usuario */
.perfil-info {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Enlaces del dropdown */
.dropdown-link {
    transition: all 0.15s ease;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-link:hover {
    background-color: #f3f4f6;
    color: #1f2937;
    transform: translateX(4px);
}

.dropdown-link i {
    width: 16px;
    text-align: center;
    color: #6b7280;
}

.dropdown-link:hover i {
    color: #374151;
}

/* Separadores */
.dropdown-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

/* Botón de cerrar sesión */
.dropdown-link.logout {
    color: #dc2626;
}

.dropdown-link.logout:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}

.dropdown-link.logout i {
    color: #ef4444;
}

/* Responsive para móviles */
@media (max-width: 768px) {

    #notificacionesDropdown,
    #perfilDropdown {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .dropdown-link {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Asegurar que los dropdowns estén por encima de todo */
#notificacionesDropdown,
#perfilDropdown {
    z-index: 10000 !important;
}

/* Overlay para móviles */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

/* Mostrar overlay en móviles cuando dropdown está abierto */
@media (max-width: 768px) {
    .dropdown-overlay.active {
        display: block;
    }
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 640px) {

    #notificacionesDropdown,
    #perfilDropdown {
        width: 95vw;
        margin: 0 10px;
    }

    .header-container {
        padding: 0 16px;
    }
}

/* Asegurar que el header tenga el z-index correcto */
header.bg-gradient-to-r {
    z-index: 1000;
    position: relative;
}

/* Contenedor de botones del header */
.header-buttons {
    position: relative;
    z-index: 1001;
}

/* Botones de notificaciones y perfil */
.notifications-button,
.profile-button {
    position: relative;
    z-index: 1002;
}
