/* ============================================================
   Sistema Dinamico de Notificaciones
   ============================================================ */

#header {
    position: relative;
    z-index: 1050;
    overflow: visible !important;
}

#header .container,
#header .row {
    overflow: visible !important;
}

#notificacionesDropdownContainer {
    position: relative;
    flex: 0 0 auto;
}

#notificacionesDropdown {
    line-height: 1;
    text-decoration: none;
}

#notificacionesDropdown:hover,
#notificacionesDropdown:focus {
    color: var(--bs-primary) !important;
    box-shadow: none;
}

#notificacionesDropdownContainer .dropdown-menu {
    position: absolute !important;
    width: 360px;
    max-width: calc(100vw - 1rem);
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1090;
}

#notificacionesDropdownContainer .dropdown-header {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.5rem 0.5rem 0 0;
}

#listaNotificaciones {
    max-height: 360px;
    overflow-x: hidden;
    overflow-y: auto;
}

#notificacionesDropdownContainer .dropdown-item-notificacion {
    cursor: pointer;
    border-bottom: 1px solid var(--bs-border-color);
    border-left: 3px solid transparent;
    white-space: normal;
    transition:
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out;
}

#notificacionesDropdownContainer
    .dropdown-item-notificacion:last-child {
    border-bottom: 0;
}

#notificacionesDropdownContainer
    .dropdown-item-notificacion.notificacion-no-leida {
    background-color: var(--bs-primary-bg-subtle);
    border-left-color: var(--bs-primary);
}

#notificacionesDropdownContainer
    .dropdown-item-notificacion.notificacion-leida {
    background-color: var(--bs-body-bg);
    border-left-color: transparent;
}

#notificacionesDropdownContainer
    .dropdown-item-notificacion:hover {
    background-color: var(--bs-tertiary-bg);
}

#notificacionesDropdownContainer
    .dropdown-item-notificacion.notificacion-no-leida:hover {
    background-color: var(--bs-primary-bg-subtle);
}

.notificacion-icono {
    display: inline-flex;
    flex: 0 0 1.25rem;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    min-height: 1.25rem;
    font-size: 1rem;
}

.notificacion-no-leida .notificacion-icono {
    color: var(--bs-primary);
}

.notificacion-leida .notificacion-icono {
    color: var(--bs-secondary-color);
}

.notificacion-no-leida .notificacion-titulo {
    color: var(--bs-body-color);
    font-weight: 600;
}

.notificacion-leida .notificacion-titulo {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

.notificacion-no-leida .notificacion-tipo {
    color: var(--bs-primary);
}

.notificacion-leida .notificacion-tipo {
    color: var(--bs-secondary-color);
}

.notificacion-tiempo {
    font-size: 0.75rem;
}

.min-width-0 {
    min-width: 0;
}

#notificacionesBadge {
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    font-size: 0.65rem;
    line-height: 1.2rem;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

#toastNotificacionesContainer .toast {
    min-width: 320px;
    max-width: 400px;
    overflow: hidden;
    border: 0;
    border-left: 4px solid var(--bs-primary);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
    animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#toastNotificacionesContainer .toast-header {
    padding: 0.6rem 0.75rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

#toastNotificacionesContainer .toast-header .fa-bell {
    color: var(--bs-primary);
}

#toastNotificacionesContainer .toast-body {
    padding: 0.75rem;
    background-color: var(--bs-body-bg);
}

#toastNotificacionesContainer
    .toast-body
    .btn-outline-primary {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
}

.btn-marcar-leida {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.dropdown-item-notificacion:hover .btn-marcar-leida,
.btn-marcar-leida:focus {
    opacity: 1;
}

@media (max-width: 576px) {
    #notificacionesDropdownContainer .dropdown-menu {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    #listaNotificaciones {
        max-height: 60vh;
    }

    #toastNotificacionesContainer .toast {
        min-width: auto;
        max-width: 100vw;
        border-radius: 0;
    }
}