/* Variables CSS para fácil personalización */
:root {
    --notification-primary: #2563eb;
    --notification-hover: #f8fafc;
    --notification-border: #e2e8f0;
    --notification-text: #334155;
    --notification-text-light: #64748b;
    --notification-badge: #ef4444;
    --notification-success: #10b981;
    --notification-warning: #f59e0b;
    --notification-info: #3b82f6;
}

/* Animación sutil para la campanita */
.notification-bell {
    display: inline-block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

/* Animación de campanita cuando hay notificaciones nuevas */
@keyframes gentle-ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

.campanita-icono {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.notification-bell .campanita-icono {
    animation: gentle-ring 2s ease-in-out infinite;
}


.notify {
    background-color: rgb(255 255 255 / 29%) !important;
    padding: 5px 5px 1px 5px;
    border-radius: 5px;
}

.has-notifications {
    padding-right: -5px;
    margin-right: -0px
}

.notify-alert {
    z-index: 100;
    vertical-align: middle;
}

#id_numero_notificacion {
    margin-bottom: 3px
}

/*.campanita-icono {*/
/*    height: 25px;*/
/*    top: 40px;*/
/*    z-index: 100;*/
/*    animation: campanita-dorada 0.5s infinite;*/
/*}*/

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--notification-border);
}

.notifications-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--notification-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.contenido_notificacion {
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

/* Scrollbar personalizado */
.contenido_notificacion::-webkit-scrollbar {
    width: 6px;
}

.notifications-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.contenido_notificacion::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.contenido_notificacion::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.notificacion-contenedor {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notificacion-contenedor:hover {
    background: var(--notification-hover);
}

.notificacion-contenedor.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--notification-primary);
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--notification-hover);
    transition: transform 0.2s ease;
}

.notificacion-contenedor:hover .notification-icon {
    transform: scale(1.05);
}

/* Colores de iconos según tipo */
.notification-icon.type-tarea {
    background: #dbeafe;
    color: #2563eb;
}

.notification-icon.type-evaluacion {
    background: #fef3c7;
    color: #f59e0b;
}

.notification-icon.type-mensaje {
    background: #dcfce7;
    color: #10b981;
}

.notification-icon.type-alerta {
    background: #fee2e2;
    color: #ef4444;
}

.notification-icon.type-default {
    background: #dbeafe;
    color: #2563eb;
}

.notification-icon.type-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.notification-icon.type-info {
    background: #dbeafe;
    color: #2563eb;
}

.notification-icon.type-infor {
    background: #dbeafe;
    color: #5a89f4;
}

.notification-icon.type-error {
    background: #fee2e2;
    color: #ef4444;
}

.notification-icon svg {
    height: 25px !important;
}

/* Contenido de la notificación */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--notification-text);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.notification-description {
    font-size: 13px;
    color: var(--notification-text-light);
    margin: 0 0 6px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-time i {
    font-size: 10px;
}

/* Tablets y dispositivos medianos (768px - 991px) */
@media (max-width: 991px) {
    .dropdown-menu.custom-dropdown {
        width: 350px !important;
        left: -100px !important;
    }
}

/* Dispositivos móviles grandes (576px - 767px) */
@media (max-width: 767px) {
    .dropdown-menu.custom-dropdown {
        width: 320px !important;
        left: -80px !important;
    }

    .notifications-title {
        font-size: 16px;
    }

    .notification-title {
        font-size: 13px;
    }

    .notification-description {
        font-size: 11px;
    }
}

/* Dispositivos móviles pequeños (480px - 575px) */
@media (max-width: 575px) {
    .dropdown-menu.custom-dropdown {
        width: 300px !important;
        /*left: -130px !important;*/
        /*right: 10px;*/
        padding: 2px !important;
    }

    .notifications-header {
        padding: 8px 10px;
    }

    .notifications-title {
        font-size: 15px;
        margin: 5px 0;
    }

    .notificacion-contenedor {
        padding: 8px 6px;
        margin-bottom: 3px;
    }

    .notification-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .notification-content {
        flex: 1;
        padding: 0 8px;
    }

    .notification-title {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .notification-description {
        font-size: 10px;
        line-height: 1.3;
    }

    .notification-unread-dot {
        width: 7px;
        height: 7px;
    }
}

/* iPhone SE y dispositivos muy pequeños (375px - 479px) */
@media (max-width: 479px) {
    .dropdown-menu.custom-dropdown {
        width: calc(100vw - 20px) !important;
        max-width: 360px !important;
        left: 200 !important;
        right: auto !important;
        margin: 0 10px;
    }

    .notifications-header {
        padding: 10px 12px;
        border-bottom: 1px solid #e0e0e0;
    }

    .notifications-title {
        font-size: 16px;
        font-weight: 600;
        margin: 0;
    }

    #contenido_notificacion {
        max-height: 400px;
        overflow-y: auto;
    }

    .notificacion-contenedor {
        display: flex;
        align-items: flex-start;
        padding: 10px 8px;
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .notification-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 14px;
        margin-right: 8px;
    }

    .notification-content {
        flex: 1;
        min-width: 0;
        padding-right: 8px;
    }

    .notification-title {
        font-size: 13px;
        font-weight: 600;
        margin: 0 0 4px 0;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .notification-description {
        font-size: 11px;
        color: #666;
        line-height: 1.4;
        margin: 0;
    }

    .notification-description .fa-clock-o {
        font-size: 10px;
        margin-right: 3px;
    }

    .notification-status {
        display: flex;
        align-items: flex-start;
        padding-top: 2px;
        color: var(--notification-text-light) !important;
    }

    .notification-unread-dot {
        width: 8px;
        height: 8px;
        min-width: 8px;
        background-color: #007bff;
        border-radius: 50%;
    }

    .ver_totas_notificaciones {
        margin: 5px !important;
        padding: 8px !important;
    }

    .ver_totas_notificaciones .text-center {
        font-size: 12px !important;
    }
}

/* Dispositivos extra pequeños (< 375px) */
@media (max-width: 374px) {
    .dropdown-menu.custom-dropdown {
        width: calc(100vw - 10px) !important;
        max-width: 340px !important;
        margin: 0 5px;
        transform: translateX(5%) !important;
    }

    .notifications-title {
        font-size: 15px;
    }

    .notification-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 13px;
        margin-right: 6px;
    }

    .notification-title {
        font-size: 12px;
    }

    .notification-description {
        font-size: 10px;
    }

    .notificacion-contenedor {
        padding: 8px 6px;
    }
}

/* Estilos adicionales para mejorar la experiencia móvil */
@media (max-width: 479px) {
    /* Scroll suave para el contenedor de notificaciones */
    #contenido_notificacion {
        -webkit-overflow-scrolling: touch;
    }

    /* Mejorar el área de toque */
    .notificacion-contenedor {
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .notificacion-contenedor:active {
        background-color: #f5f5f5;
    }

    /* Iconos de tipo de notificación con colores */
    .notification-icon.type-mensaje {
        background-color: #e3f2fd;
        color: #1976d2;
    }

    .notification-icon.type-tarea {
        background-color: #fff3e0;
        color: #f57c00;
    }

    .notification-icon.type-alerta {
        background-color: #ffebee;
        color: #d32f2f;
    }

    .notification-icon.type-evaluacion {
        background-color: #e8f5e9;
        color: #388e3c;
    }
}

/* Orientación horizontal para móviles */
@media (max-height: 500px) and (orientation: landscape) {
    #contenido_notificacion {
        max-height: 250px;
    }

    .dropdown-menu.custom-dropdown {
        max-height: 350px;
    }
}