/* =====================================================
   COMPONENTE: CAMPANITA DE NOTIFICACIONES
   ===================================================== */

.notification-bell {
    position: relative;
    display: inline-block;
}

/* Botón de la campanita - mismo estilo que notes-button */
.bell-button {
    position: relative;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1em;
    width: 40px;
    height: 40px;
}

.bell-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.bell-button.has-notifications {
    animation: ring 2s ease-in-out infinite;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

/* Badge de contador */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5);
    animation: pulse-badge 2s ease-in-out infinite;
}

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

/* Overlay */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
}

/* Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.2s ease-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del dropdown */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dropdown-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
}

.mark-all-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mark-all-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mark-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.dropdown-loading {
    padding: 40px;
    text-align: center;
    color: #999;
}

.loading-spinner-small {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Empty state */
.dropdown-empty {
    padding: 50px 20px;
    text-align: center;
    color: #999;
}

/* Lista de notificaciones */
.notification-list {
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 14px;
    background: white;
}

.notification-item:hover {
    background: #f9fafb;
    transform: translateX(2px);
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.notification-item.unread:hover {
    background: #dbeafe;
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-title {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

.notification-material-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

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

.notification-arrow {
    color: #d1d5db;
    font-size: 12px;
    flex-shrink: 0;
}

/* Footer */
.dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 360px;
        max-height: 500px;
    }

    .notification-list {
        max-height: 400px;
    }

    .notification-item {
        padding: 14px 18px;
    }

    .mark-all-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 640px) {
    .bell-button {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }

    .notification-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        left: auto;
        bottom: auto;
        width: calc(100vw - 20px);
        max-width: 360px;
        max-height: 70vh;
        transform: translateX(0);
    }
    
    .notification-bell {
        position: relative;
    }
}
